From: Florian Krohm Date: Fri, 31 May 2013 15:41:55 +0000 (+0000) Subject: s390x: Make the CC_DEP1 field appear completely initialised when X-Git-Tag: svn/VALGRIND_3_9_0^2~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95c7372d6952cc1c164e238a7fc4b5e84fd46e3d;p=thirdparty%2Fvalgrind.git s390x: Make the CC_DEP1 field appear completely initialised when 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 --- diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index f33189790a..583880455d 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -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);