]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
ppc64: lxvw4x instruction uses four 32-byte loads. When run on an
authorCarl Love <cel@us.ibm.com>
Mon, 29 Sep 2014 19:33:00 +0000 (19:33 +0000)
committerCarl Love <cel@us.ibm.com>
Mon, 29 Sep 2014 19:33:00 +0000 (19:33 +0000)
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

VEX/priv/guest_ppc_toIR.c

index 60c52fe8e52ada931590bc6398696f7e0e51172a..2461b6888ee9a756997aaad2fad18312415f8e48 100644 (file)
@@ -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: