|
From: <sv...@va...> - 2006-05-19 23:09:12
|
Author: sewardj
Date: 2006-05-20 00:09:03 +0100 (Sat, 20 May 2006)
New Revision: 1619
Log:
Clear up yet another gcc-4.1.0 stunt leading to false uninitialised
value errors on SuSE 10.1 (x86) running konqueror.
Modified:
trunk/priv/guest-x86/ghelpers.c
Modified: trunk/priv/guest-x86/ghelpers.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/guest-x86/ghelpers.c 2006-05-15 12:23:17 UTC (rev 1618)
+++ trunk/priv/guest-x86/ghelpers.c 2006-05-19 23:09:03 UTC (rev 1619)
@@ -775,7 +775,7 @@
/* Used by the optimiser to try specialisations. Returns an
equivalent expression, or NULL if none. */
=20
-static Bool isU32 ( IRExpr* e, UInt n )
+static inline Bool isU32 ( IRExpr* e, UInt n )
{
return=20
toBool( e->tag =3D=3D Iex_Const
@@ -913,6 +913,21 @@
binop(Iop_And32,cc_dep1,mkU32(0xFF))));
}
=20
+ 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)=20
+ --> test dst <s 0
+ --> (UInt)dst[7]=20
+ 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 ----------------*/
=20
if (isU32(cc_op, X86G_CC_OP_LOGICL) && isU32(cond, X86CondZ)) {
|