]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/tree-ssa-forwprop.c
2009-04-03 Richard Guenther <rguenther@suse.de>
[thirdparty/gcc.git] / gcc / tree-ssa-forwprop.c
index 044f8436559e38158363744ef769ff8ff5f27466..c3e7d432528627fca812e1e53638ef264fdb6020 100644 (file)
@@ -594,8 +594,6 @@ tidy_after_forward_propagate_addr (gimple stmt)
 
   if (TREE_CODE (gimple_assign_rhs1 (stmt)) == ADDR_EXPR)
      recompute_tree_invariant_for_addr_expr (gimple_assign_rhs1 (stmt));
-
-  mark_symbols_for_renaming (stmt);
 }
 
 /* DEF_RHS contains the address of the 0th element in an array.
@@ -930,18 +928,24 @@ forward_propagate_addr_expr (tree name, tree rhs)
          continue;
        }
 
-      push_stmt_changes (&use_stmt);
-
       {
        gimple_stmt_iterator gsi = gsi_for_stmt (use_stmt);
+       push_stmt_changes (&use_stmt);
        result = forward_propagate_addr_expr_1 (name, rhs, &gsi,
                                                single_use_p);
-       use_stmt = gsi_stmt (gsi);
+       /* If the use has moved to a different statement adjust
+          the update machinery.  */
+       if (use_stmt != gsi_stmt (gsi))
+         {
+           pop_stmt_changes (&use_stmt);
+           use_stmt = gsi_stmt (gsi);
+           update_stmt (use_stmt);
+         }
+       else
+         pop_stmt_changes (&use_stmt);
       }
       all &= result;
 
-      pop_stmt_changes (&use_stmt);
-
       /* Remove intermediate now unused copy and conversion chains.  */
       use_rhs = gimple_assign_rhs1 (use_stmt);
       if (result