]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 417281 - s390x: Fix register usage of conditional moves
authorAndreas Arnez <arnez@linux.ibm.com>
Wed, 18 Mar 2020 11:24:25 +0000 (12:24 +0100)
committerAndreas Arnez <arnez@linux.ibm.com>
Wed, 18 Mar 2020 18:28:24 +0000 (19:28 +0100)
The s390x register usage callback marks the target register of a
conditional move as HRmWrite only.  It fails to mention the fact that the
target register is also an input to the insn (unless the condition is
"never" or "always").

This was discovered while investigating "grail" failures on s390x and
fixes the majority of them.

NEWS
VEX/priv/host_s390_defs.c
docs/internals/3_15_BUGSTATUS.txt

diff --git a/NEWS b/NEWS
index d7852320e5c5dd947ab9bebf333222c69cda6f65..52377430ce1756002195ee26ec3ba3d4de9d08ef 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -127,6 +127,7 @@ where XXXXXX is the bug number as listed below.
 417906  clone with CLONE_VFORK and no CLONE_VM fails
 418435  s390x: memcmp test yields extra "Conditional jump or move depends on
         uninitialised value(s)"
+417281  s390x: /bin/true segfaults with "grail" enabled
 n-i-bz  Fix minor one time leaks in dhat.
 n-i-bz  Add --run-cxx-freeres=no in outer args to avoid inner crashes.
 n-i-bz  Add support for the Linux io_uring system calls
index 80e56f603aa466b06f1579cc16e8db11fb003da8..b9b2158190723f86cdc7f7881aab0e042d1b3176 100644 (file)
@@ -676,8 +676,18 @@ s390_insn_get_reg_usage(HRegUsage *u, const s390_insn *insn)
       break;
 
    case S390_INSN_COND_MOVE:
-      s390_opnd_RMI_get_reg_usage(u, insn->variant.cond_move.src);
-      addHRegUse(u, HRmWrite, insn->variant.cond_move.dst);
+      switch (insn->variant.cond_move.cond) {
+      case S390_CC_NEVER:
+         break;
+      case S390_CC_ALWAYS:
+         s390_opnd_RMI_get_reg_usage(u, insn->variant.cond_move.src);
+         addHRegUse(u, HRmWrite, insn->variant.cond_move.dst);
+         break;
+      default:
+         s390_opnd_RMI_get_reg_usage(u, insn->variant.cond_move.src);
+         addHRegUse(u, HRmModify, insn->variant.cond_move.dst);
+         break;
+      }
       break;
 
    case S390_INSN_ALU:
index ac4b5f48f56fef322ec96c954c231f876784acc6..9509426a04e2677cb954a60205f62893c9f4a8e7 100644 (file)
@@ -204,9 +204,6 @@ Uhmm, MUSL
 .417266  Make memcheck/tests/linux/sigqueue usable with musl
 Uhmm, MUSL
 
-.417281  s390x: /bin/true segfaults with "grail" enabled
-Ongoing
-
 .417377  False-positive "uninitialised value(s)" reports from memcheck
 
 .417572  unhandled instruction bytes: 0xC5 0x79 0xD6 0xED 0xC5 0xF9 0x51