]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Clear up yet another gcc-4.1.0 stunt leading to false uninitialised
authorJulian Seward <jseward@acm.org>
Fri, 19 May 2006 23:09:03 +0000 (23:09 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 19 May 2006 23:09:03 +0000 (23:09 +0000)
value errors on SuSE 10.1 (x86) running konqueror.

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

VEX/priv/guest-x86/ghelpers.c

index ce38a87956a743cd98cb8f529a002e53a418315d..1929f02949a376c85e185da6a8a39d4c5ccacd47 100644 (file)
@@ -775,7 +775,7 @@ LibVEX_GuestX86_put_eflag_c ( UInt new_carry_flag,
 /* Used by the optimiser to try specialisations.  Returns an
    equivalent expression, or NULL if none. */
 
-static Bool isU32 ( IRExpr* e, UInt n )
+static inline Bool isU32 ( IRExpr* e, UInt n )
 {
    return 
       toBool( e->tag == Iex_Const
@@ -913,6 +913,21 @@ IRExpr* guest_x86_spechelper ( HChar* function_name,
                           binop(Iop_And32,cc_dep1,mkU32(0xFF))));
       }
 
+      if (isU32(cc_op, X86G_CC_OP_SUBB) && isU32(cond, X86CondS)
+                                        && isU32(cc_dep2, 0)) {
+         /* long sub/cmp, then S --> test (dst-0 <s 0) 
+                                 --> test dst <s 0
+                                 --> (UInt)dst[7] 
+            This is yet another scheme by which gcc figures out if the
+            top bit of a byte is 1 or 0.  See also LOGICB/CondS below. */
+         /* Note: isU32(cc_dep2, 0) is correct, even though this is
+            for an 8-bit comparison, since the args to the helper
+            function are always U32s. */
+         return binop(Iop_And32,
+                      binop(Iop_Shr32,cc_dep1,mkU8(7)),
+                      mkU32(1));
+      }
+
       /*---------------- LOGICL ----------------*/
 
       if (isU32(cc_op, X86G_CC_OP_LOGICL) && isU32(cond, X86CondZ)) {