diff --git a/bolt/utils/llvm-bolt-wrapper.py b/bolt/utils/llvm-bolt-wrapper.py --- a/bolt/utils/llvm-bolt-wrapper.py +++ b/bolt/utils/llvm-bolt-wrapper.py @@ -206,7 +206,8 @@ Extracts byte number from cmp output: file1 file2 differ: byte X, line Y ''' - return int(re.search(r'byte (\d+),', cmp_out).groups()[0]) + # NOTE: cmp counts bytes starting from 1! + return int(re.search(r'byte (\d+),', cmp_out).groups()[0]) - 1 def report_real_time(binary, main_err, cmp_err, cfg): '''