]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390x: Drop spurious register moves in CDAS instruction selector
authorAndreas Arnez <arnez@linux.ibm.com>
Fri, 3 Apr 2020 17:16:01 +0000 (19:16 +0200)
committerAndreas Arnez <arnez@linux.ibm.com>
Wed, 8 Apr 2020 17:39:46 +0000 (19:39 +0200)
The s390x instruction selector for Ist_CAS, in its handling of "compare
double and swap", adds spurious register moves after the CDAS operation
itself.  These moves overwrite registers returned by calls to
s390_isel_int_expr(), potentially causing corruption of temp values.

Delete the spurious move operations after CDAS.

VEX/priv/host_s390_isel.c

index 882e72cd6c2b27d11ea787af744db26c9eb77d64..2f80dd8504129a3e323e47d7a6d9fa0282deb5f0 100644 (file)
@@ -5185,10 +5185,6 @@ no_memcpy_put:
             addInstr(env, s390_insn_cdas(8, r8, r9, op2, r10, r11,
                                          old_high, old_low, r1));
          }
-         addInstr(env, s390_insn_move(8, op1_high, r8));
-         addInstr(env, s390_insn_move(8, op1_low,  r9));
-         addInstr(env, s390_insn_move(8, op3_high, r10));
-         addInstr(env, s390_insn_move(8, op3_low,  r11));
          return;
       }
       break;