tree-ssa-uncprop.c (equiv_stack): Change the type o VEC(tree,heap).
authorKazu Hirata <kazu@cs.umass.edu>
Sun, 24 Apr 2005 23:23:33 +0000 (23:23 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sun, 24 Apr 2005 23:23:33 +0000 (23:23 +0000)
* tree-ssa-uncprop.c (equiv_stack): Change the type o
VEC(tree,heap).
(tree_ssa_uncprop, uncprop_finalize_block,
uncprop_initialize_block): Update uses of equiv_stack.

From-SVN: r98684

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

index 1704e1c4404e63eeb22317e610b4e83f45d80f55..2b52cb379c7018e8a0e0303c24bf6cb1055d335d 100644 (file)
@@ -1,3 +1,10 @@
+2005-04-24  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * tree-ssa-uncprop.c (equiv_stack): Change the type o
+       VEC(tree,heap).
+       (tree_ssa_uncprop, uncprop_finalize_block,
+       uncprop_initialize_block): Update uses of equiv_stack.
+
 2005-04-24  Richard Henderson  <rth@redhat.com>
 
        PR rtl-opt/21163
index a73c27155e9d90e7cf31c0b5ba81ac48470fa29f..9f06e38f3c7f9d0a9d3543ff551d24e16d792fb0 100644 (file)
@@ -286,7 +286,7 @@ associate_equivalences_with_edges (void)
    leading to this block.  If no such edge equivalency exists, then we
    record NULL.  These equivalences are live until we leave the dominator
    subtree rooted at the block where we record the equivalency.  */
-static varray_type equiv_stack;
+static VEC(tree,heap) *equiv_stack;
 
 /* Global hash table implementing a mapping from invariant values
    to a list of SSA_NAMEs which have the same value.  We might be
@@ -380,7 +380,7 @@ tree_ssa_uncprop (void)
 
   /* Create our global data structures.  */
   equiv = htab_create (1024, equiv_hash, equiv_eq, free);
-  VARRAY_TREE_INIT (equiv_stack, 2, "Block equiv stack");
+  equiv_stack = VEC_alloc (tree, heap, 2);
 
   /* We're going to do a dominator walk, so ensure that we have
      dominance information.  */
@@ -410,10 +410,11 @@ tree_ssa_uncprop (void)
   /* Finalize and clean up.  */
   fini_walk_dominator_tree (&walk_data);
 
-  /* EQUIV_STACK should already be empty at this point, so we just need
-     to empty elements out of the hash table and cleanup the AUX field
-     on the edges.  */
+  /* EQUIV_STACK should already be empty at this point, so we just
+     need to empty elements out of the hash table, free EQUIV_STACK,
+     and cleanup the AUX field on the edges.  */
   htab_delete (equiv);
+  VEC_free (tree, heap, equiv_stack);
   FOR_EACH_BB (bb)
     {
       edge e;
@@ -440,10 +441,8 @@ static void
 uncprop_finalize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
                        basic_block bb ATTRIBUTE_UNUSED)
 {
-  tree value = VARRAY_TOP_TREE (equiv_stack);
-
   /* Pop the topmost value off the equiv stack.  */
-  VARRAY_POP (equiv_stack);
+  tree value = VEC_pop (tree, equiv_stack);
 
   /* If that value was non-null, then pop the topmost equivalency off
      its equivalency stack.  */
@@ -581,13 +580,13 @@ uncprop_initialize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
          struct edge_equivalency *equiv = e->aux;
 
          record_equiv (equiv->rhs, equiv->lhs);
-         VARRAY_PUSH_TREE (equiv_stack, equiv->rhs);
+         VEC_safe_push (tree, heap, equiv_stack, equiv->rhs);
          recorded = true;
        }
     }
 
   if (!recorded)
-    VARRAY_PUSH_TREE (equiv_stack, NULL_TREE);
+    VEC_safe_push (tree, heap, equiv_stack, NULL_TREE);
 }
 
 static bool