From: Julian Seward Date: Fri, 16 Feb 2018 07:02:00 +0000 (+0100) Subject: Bug 384930 - Valgrind fails to compute correctly some code using the GMP library. X-Git-Tag: VALGRIND_3_14_0~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ae2edea014669d8082747f0f268e9404e0fd296;p=thirdparty%2Fvalgrind.git Bug 384930 - Valgrind fails to compute correctly some code using the GMP library. For the ADCX and ADOX instructions, the VEX front end failed to create a PUT to the result register in the case where one of the operands is from memory, for example in adoxq 48(%rdi),%r12 where %r12 is never written. This commit fixes it. --- diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c index d00f45331c..f4620306ca 100644 --- a/VEX/priv/guest_amd64_toIR.c +++ b/VEX/priv/guest_amd64_toIR.c @@ -3080,12 +3080,12 @@ ULong dis_op2_E_G ( const VexAbiInfo* vbi, putIRegG(size, pfx, rm, mkexpr(dst1)); } else if (op8 == Iop_Add8 && flag == WithFlagCarryX) { - /* normal store */ helper_ADCX_ADOX( True/*isADCX*/, size, dst1, dst0, src ); + putIRegG(size, pfx, rm, mkexpr(dst1)); } else if (op8 == Iop_Add8 && flag == WithFlagOverX) { - /* normal store */ helper_ADCX_ADOX( False/*!isADCX*/, size, dst1, dst0, src ); + putIRegG(size, pfx, rm, mkexpr(dst1)); } else { assign( dst1, binop(mkSizedOp(ty,op8), mkexpr(dst0), mkexpr(src)) ); if (isAddSub(op8))