OSDN Git Service

* tree-ssa-dom.c (tree_ssa_dominator_optimize): Clear SSA_NAME_VALUE
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jan 2005 04:36:40 +0000 (04:36 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jan 2005 04:36:40 +0000 (04:36 +0000)
        at the end of the main DOM loop rather than just before DOM exits.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93811 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-ssa-dom.c

index be9c0a4..b85f270 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-17  Jeff Law  <law@redhat.com>
+
+       * tree-ssa-dom.c (tree_ssa_dominator_optimize): Clear SSA_NAME_VALUE
+       at the end of the main DOM loop rather than just before DOM exits.
+
 2005-01-17  Diego Novillo  <dnovillo@redhat.com>
 
        PR tree-optimization/19121
index 68bf4f9..287419f 100644 (file)
@@ -455,8 +455,26 @@ tree_ssa_dominator_optimize (void)
       htab_empty (avail_exprs);
       htab_empty (vrp_data);
 
-      for (i = 0; i < num_referenced_vars; i++)
-       var_ann (referenced_var (i))->current_def = NULL;
+      /* Finally, remove everything except invariants in SSA_NAME_VALUE.
+
+        This must be done before we iterate as we might have a
+        reference to an SSA_NAME which was removed by the call to
+        rewrite_ssa_into_ssa.
+
+        Long term we will be able to let everything in SSA_NAME_VALUE
+        persist.  However, for now, we know this is the safe thing to do.  */
+      for (i = 0; i < num_ssa_names; i++)
+       {
+         tree name = ssa_name (i);
+         tree value;
+
+         if (!name)
+           continue;
+
+         value = SSA_NAME_VALUE (name);
+         if (value && !is_gimple_min_invariant (value))
+           SSA_NAME_VALUE (name) = NULL;
+       }
     }
   while (cfg_altered);
 
@@ -478,24 +496,6 @@ tree_ssa_dominator_optimize (void)
   /* Free nonzero_vars.  */
   BITMAP_XFREE (nonzero_vars);
   BITMAP_XFREE (need_eh_cleanup);
-
-  /* Finally, remove everything except invariants in SSA_NAME_VALUE.
-
-     Long term we will be able to let everything in SSA_NAME_VALUE
-     persist.  However, for now, we know this is the safe thing to
-     do.  */
-  for (i = 0; i < num_ssa_names; i++)
-    {
-      tree name = ssa_name (i);
-      tree value;
-
-      if (!name)
-       continue;
-
-      value = SSA_NAME_VALUE (name);
-      if (value && !is_gimple_min_invariant (value))
-       SSA_NAME_VALUE (name) = NULL;
-    }
   
   VEC_free (tree_on_heap, block_defs_stack);
   VEC_free (tree_on_heap, avail_exprs_stack);