From: Julian Seward Date: Fri, 12 Mar 2021 16:55:46 +0000 (+0100) Subject: mc_translate.c: enable further uses of DLexpensive for scalar EQ/NE comparisons X-Git-Tag: VALGRIND_3_17_0~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21571252964c4d7860210cbe9f60a49eb6881824;p=thirdparty%2Fvalgrind.git mc_translate.c: enable further uses of DLexpensive for scalar EQ/NE comparisons mc_translate.c: enable further cases where scalar integer EQ/NE comparisons use expensive instrumentation by default: x86, amd64 for 16-bit comparisons arm, arm64 for 32-bit comparisons This fixes 'Bug 434193 - GCC 9+ inlined strcmp causes "Conditional jump or move depends on uninitialised value" report'. Patch from Mike Crowe . --- diff --git a/NEWS b/NEWS index cd8a509faa..028725c038 100644 --- a/NEWS +++ b/NEWS @@ -170,6 +170,7 @@ where XXXXXX is the bug number as listed below. 433629 valgrind/README has type "abd" instead of "and" 433641 Rust std::sys::unix::fs::try_statx Syscall param fstatat(file_name) 433898 arm64: Handle sp, lr, fp as DwReg in CfiExpr +434193 GCC 9+ inlined strcmp causes "Conditional jump or move [..] value" report n-i-bz helgrind: If hg_cli__realloc fails, return NULL. diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c index 516988bdd4..739f67cbf9 100644 --- a/memcheck/mc_translate.c +++ b/memcheck/mc_translate.c @@ -8586,17 +8586,22 @@ IRSB* MC_(instrument) ( VgCallbackClosure* closure, approximation to the above, and is self-contained.*/ # if defined(VGA_x86) mce.dlbo.dl_Add32 = DLauto; + mce.dlbo.dl_CmpEQ16_CmpNE16 = DLexpensive; mce.dlbo.dl_CmpEQ32_CmpNE32 = DLexpensive; # elif defined(VGA_amd64) mce.dlbo.dl_Add32 = DLexpensive; mce.dlbo.dl_Add64 = DLauto; + mce.dlbo.dl_CmpEQ16_CmpNE16 = DLexpensive; mce.dlbo.dl_CmpEQ32_CmpNE32 = DLexpensive; mce.dlbo.dl_CmpEQ64_CmpNE64 = DLexpensive; # elif defined(VGA_ppc64le) // Needed by (at least) set_AV_CR6() in the front end. mce.dlbo.dl_CmpEQ64_CmpNE64 = DLexpensive; # elif defined(VGA_arm64) + mce.dlbo.dl_CmpEQ32_CmpNE32 = DLexpensive; mce.dlbo.dl_CmpEQ64_CmpNE64 = DLexpensive; +# elif defined(VGA_arm) + mce.dlbo.dl_CmpEQ32_CmpNE32 = DLexpensive; # endif /* preInstrumentationAnalysis() will allocate &mce.tmpHowUsed and then