]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390x: Make the CC_DEP1 field appear completely initialised when
authorFlorian Krohm <florian@eich-krohm.de>
Fri, 31 May 2013 15:41:55 +0000 (15:41 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Fri, 31 May 2013 15:41:55 +0000 (15:41 +0000)
writing a 32-bit floating point value into it.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ 307113.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2724

VEX/priv/guest_s390_toIR.c

index f33189790a5b6eb5b740bdb01717cc6554374fb0..583880455d382bfd28b785c53acb8a0f94e19163 100644 (file)
@@ -632,6 +632,14 @@ s390_cc_thunk_put1f(UInt opc, IRTemp d1)
 {
    IRExpr *op, *dep1, *dep2, *ndep;
 
+   /* Make the CC_DEP1 slot appear completely defined.
+      Otherwise, assigning a 32-bit value will cause memcheck
+      to trigger an undefinedness error.
+   */
+   if (sizeofIRType(typeOfIRTemp(irsb->tyenv, d1)) == 4) {
+      UInt dep1_off = S390X_GUEST_OFFSET(guest_CC_DEP1);
+      stmt(IRStmt_Put(dep1_off, mkU64(0)));
+   }
    op   = mkU64(opc);
    dep1 = mkexpr(d1);
    dep2 = mkU64(0);
@@ -648,6 +656,14 @@ s390_cc_thunk_putFZ(UInt opc, IRTemp d1, IRTemp d2)
 {
    IRExpr *op, *dep1, *dep2, *ndep;
 
+   /* Make the CC_DEP1 slot appear completely defined.
+      Otherwise, assigning a 32-bit value will cause memcheck
+      to trigger an undefinedness error.
+   */
+   if (sizeofIRType(typeOfIRTemp(irsb->tyenv, d1)) == 4) {
+      UInt dep1_off = S390X_GUEST_OFFSET(guest_CC_DEP1);
+      stmt(IRStmt_Put(dep1_off, mkU64(0)));
+   }
    op   = mkU64(opc);
    dep1 = mkexpr(d1);
    dep2 = s390_cc_widen(d2, False);