]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix overenthusiastic redundant-Put elimination, which believed that
authorJulian Seward <jseward@acm.org>
Mon, 6 Sep 2004 23:51:00 +0000 (23:51 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 6 Sep 2004 23:51:00 +0000 (23:51 +0000)
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

VEX/priv/ir/iropt.c

index f15783715d9f8684b0a7c077626162effccff388..e337ba1d416374c09eea04bfce561bc699abcb5b 100644 (file)
@@ -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