From: Andreas Arnez Date: Fri, 3 Apr 2020 17:16:01 +0000 (+0200) Subject: s390x: Drop spurious register moves in CDAS instruction selector X-Git-Tag: VALGRIND_3_16_0~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a90a15b9c0cbf38b6a9f17e5fa28199e155de73;p=thirdparty%2Fvalgrind.git s390x: Drop spurious register moves in CDAS instruction selector 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. --- diff --git a/VEX/priv/host_s390_isel.c b/VEX/priv/host_s390_isel.c index 882e72cd6c..2f80dd8504 100644 --- a/VEX/priv/host_s390_isel.c +++ b/VEX/priv/host_s390_isel.c @@ -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;