]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
mc_translate.c: enable further uses of DLexpensive for scalar EQ/NE comparisons
authorJulian Seward <jseward@acm.org>
Fri, 12 Mar 2021 16:55:46 +0000 (17:55 +0100)
committerJulian Seward <jseward@acm.org>
Fri, 12 Mar 2021 16:59:01 +0000 (17:59 +0100)
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 <mac@mcrowe.com>.

NEWS
memcheck/mc_translate.c

diff --git a/NEWS b/NEWS
index cd8a509faa6542f19b0d4738075edbd07722bed9..028725c038bdbea9895c1dc79f2e847f236b83a3 100644 (file)
--- 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.
 
 
index 516988bdd43399eb8d2eb6219f11102dae590161..739f67cbf95a39bfc19fd5c1d896a08e91e32e36 100644 (file)
@@ -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