From: Carl Love Date: Mon, 29 Sep 2014 19:33:00 +0000 (+0000) Subject: ppc64: lxvw4x instruction uses four 32-byte loads. When run on an X-Git-Tag: svn/VALGRIND_3_11_0^2~189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38e7b60e98d7fdbb560c46978941ba1fd9e442a2;p=thirdparty%2Fvalgrind.git ppc64: lxvw4x instruction uses four 32-byte loads. When run on an application that does partial loads an error message is generated by valgrind about Invalid read of size 4. Valgrind is incorrectly detecting the invalid read. The four loads were replaced by a single 128-bit load. The invalid read message can now be suppressed using the command line option " --partial-loads-ok=yes ". This fix is for Valgrind bugzilla 339433. git-svn-id: svn://svn.valgrind.org/vex/trunk@2962 --- diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c index 60c52fe8e5..2461b6888e 100644 --- a/VEX/priv/guest_ppc_toIR.c +++ b/VEX/priv/guest_ppc_toIR.c @@ -15319,26 +15319,12 @@ dis_vx_load ( UInt theInstr ) } case 0x30C: { - IRExpr * t3, *t2, *t1, *t0; - UInt ea_off = 0; - IRExpr* irx_addr; + IRExpr *t0; DIP("lxvw4x %d,r%u,r%u\n", (UInt)XT, rA_addr, rB_addr); - t3 = load( Ity_I32, mkexpr( EA ) ); - ea_off += 4; - irx_addr = binop( mkSzOp( ty, Iop_Add8 ), mkexpr( EA ), - ty == Ity_I64 ? mkU64( ea_off ) : mkU32( ea_off ) ); - t2 = load( Ity_I32, irx_addr ); - ea_off += 4; - irx_addr = binop( mkSzOp( ty, Iop_Add8 ), mkexpr( EA ), - ty == Ity_I64 ? mkU64( ea_off ) : mkU32( ea_off ) ); - t1 = load( Ity_I32, irx_addr ); - ea_off += 4; - irx_addr = binop( mkSzOp( ty, Iop_Add8 ), mkexpr( EA ), - ty == Ity_I64 ? mkU64( ea_off ) : mkU32( ea_off ) ); - t0 = load( Ity_I32, irx_addr ); - putVSReg( XT, binop( Iop_64HLtoV128, binop( Iop_32HLto64, t3, t2 ), - binop( Iop_32HLto64, t1, t0 ) ) ); + + t0 = load( Ity_V128, mkexpr( EA ) ); + putVSReg( XT, t0 ); break; } default: