From: Julian Seward Date: Mon, 6 Sep 2004 23:51:00 +0000 (+0000) Subject: Fix overenthusiastic redundant-Put elimination, which believed that X-Git-Tag: svn/VALGRIND_3_0_1^2~1100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a3e23befb98a64940fe986b175963a71bf931a7;p=thirdparty%2Fvalgrind.git Fix overenthusiastic redundant-Put elimination, which believed that PutI[x,y] makes a previous PutI[x,y] redundant, for the same x,y. git-svn-id: svn://svn.valgrind.org/vex/trunk@234 --- diff --git a/VEX/priv/ir/iropt.c b/VEX/priv/ir/iropt.c index f15783715d..e337ba1d41 100644 --- a/VEX/priv/ir/iropt.c +++ b/VEX/priv/ir/iropt.c @@ -980,7 +980,8 @@ static void handle_gets_Stmt ( Hash64* env, IRStmt* st ) break; case Iex_GetI: isGet = True; - key = mk_key_GetIPutI ( e->Iex.GetI.minoff, e->Iex.GetI.maxoff ); + key = mk_key_GetIPutI ( e->Iex.GetI.minoff, + e->Iex.GetI.maxoff ); break; default: isGet = False; @@ -1003,6 +1004,11 @@ static void handle_gets_Stmt ( Hash64* env, IRStmt* st ) vassert(isAtom(st->Ist.Exit.cond)); return; + case Ist_PutI: + vassert(isAtom(st->Ist.PutI.offset)); + vassert(isAtom(st->Ist.PutI.expr)); + return; + default: vex_printf("\n"); ppIRStmt(st); @@ -1061,12 +1067,13 @@ static void redundant_put_removal_BB ( IRBB* bb ) isPut = True; key = mk_key_GetIPutI( st->Ist.PutI.minoff, st->Ist.PutI.maxoff ); + vassert(isAtom(st->Ist.PutI.offset)); vassert(isAtom(st->Ist.PutI.expr)); break; default: isPut = False; } - if (isPut) { + if (isPut && st->tag != Ist_PutI) { /* See if any single entry in env overlaps this Put. This is simplistic in that the transformation is valid if, say, two or more entries in the env overlap this Put, but the use of