From 2cf09703f6e79396d0b2b7b2e36dd03e3f945739 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Fri, 19 May 2006 23:09:03 +0000 Subject: [PATCH] Clear up yet another gcc-4.1.0 stunt leading to false uninitialised 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 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/VEX/priv/guest-x86/ghelpers.c b/VEX/priv/guest-x86/ghelpers.c index ce38a87956..1929f02949 100644 --- a/VEX/priv/guest-x86/ghelpers.c +++ b/VEX/priv/guest-x86/ghelpers.c @@ -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 test dst (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)) { -- 2.47.3