Index: tree-ssa-dce.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dce.c,v retrieving revision 2.28 diff -u -p -r2.28 tree-ssa-dce.c --- tree-ssa-dce.c 22 Nov 2004 12:23:58 -0000 2.28 +++ tree-ssa-dce.c 26 Nov 2004 23:19:40 -0000 @@ -74,7 +74,7 @@ static struct stmt_stats int removed_phis; } stats; -static varray_type worklist; +static VEC(tree_on_heap) *worklist; /* Vector indicating an SSA name has already been processed and marked as necessary. */ @@ -232,7 +232,7 @@ mark_stmt_necessary (tree stmt, bool add NECESSARY (stmt) = 1; if (add_to_worklist) - VARRAY_PUSH_TREE (worklist, stmt); + VEC_safe_push (tree_on_heap, worklist, stmt); } /* Mark the statement defining operand OP as necessary. PHIONLY is true @@ -260,7 +260,7 @@ mark_operand_necessary (tree op, bool ph return; NECESSARY (stmt) = 1; - VARRAY_PUSH_TREE (worklist, stmt); + VEC_safe_push (tree_on_heap, worklist, stmt); } @@ -546,11 +546,10 @@ propagate_necessity (struct edge_list *e if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "\nProcessing worklist:\n"); - while (VARRAY_ACTIVE_SIZE (worklist) > 0) + while (VEC_length (tree_on_heap, worklist) > 0) { /* Take `i' from worklist. */ - i = VARRAY_TOP_TREE (worklist); - VARRAY_POP (worklist); + i = VEC_pop (tree_on_heap, worklist); if (dump_file && (dump_flags & TDF_DETAILS)) { @@ -677,10 +676,9 @@ mark_really_necessary_kill_operand_phis /* Mark all virtual phis still in use as necessary, and all of their arguments that are phis as necessary. */ - while (VARRAY_ACTIVE_SIZE (worklist) > 0) + while (VEC_length (tree_on_heap, worklist) > 0) { - tree use = VARRAY_TOP_TREE (worklist); - VARRAY_POP (worklist); + tree use = VEC_pop (tree_on_heap, worklist); for (i = 0; i < PHI_NUM_ARGS (use); i++) mark_operand_necessary (PHI_ARG_DEF (use, i), true); @@ -887,7 +885,7 @@ tree_dce_init (bool aggressive) processed = sbitmap_alloc (num_ssa_names + 1); sbitmap_zero (processed); - VARRAY_TREE_INIT (worklist, 64, "work list"); + worklist = VEC_alloc (tree_on_heap, 64); } /* Cleanup after this pass. */ @@ -907,6 +905,7 @@ tree_dce_done (bool aggressive) } sbitmap_free (processed); + VEC_free (tree_on_heap, worklist); } /* Main routine to eliminate dead code.