diff options
author | Steven Bosscher <steven@gcc.gnu.org> | 2012-08-08 17:39:46 +0000 |
---|---|---|
committer | Steven Bosscher <steven@gcc.gnu.org> | 2012-08-08 17:39:46 +0000 |
commit | 89e6c19777b52091fca292e9bf13235b0d0091fb (patch) | |
tree | b760397677133adc286f0671661422a803af861f /gcc/tree-into-ssa.c | |
parent | c2a45eabbe46e258d683c61058e4d3260c484132 (diff) |
PR middle-end/54146
* gimpify.c (gimplify_body): Only verify_gimple_in_seq with
checking enabled.
* tree-ssa-loop-manip.c (add_exit_phis_var): Assert that var is
a gimple_reg if checking is enabled.
(find_uses_to_rename_stmt): Only look at non-virtual USE operands.
* tree-into-ssa (compute_global_livein): Change the worklist
type from an array to a VEC.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@190235 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-into-ssa.c')
-rw-r--r-- | gcc/tree-into-ssa.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c index eb1ef6c1c9a..52f0bdc71a9 100644 --- a/gcc/tree-into-ssa.c +++ b/gcc/tree-into-ssa.c @@ -408,26 +408,28 @@ set_current_def (tree var, tree def) for LIVEIN). */ void -compute_global_livein (bitmap livein ATTRIBUTE_UNUSED, bitmap def_blocks ATTRIBUTE_UNUSED) +compute_global_livein (bitmap livein, bitmap def_blocks) { - basic_block bb, *worklist, *tos; unsigned i; bitmap_iterator bi; + VEC (basic_block, heap) *worklist; - tos = worklist - = (basic_block *) xmalloc (sizeof (basic_block) * (last_basic_block + 1)); + /* Normally the work list size is bounded by the number of basic + blocks in the largest loop. We don't know this number, but we + can be fairly sure that it will be relatively small. */ + worklist = VEC_alloc (basic_block, heap, MAX (8, n_basic_blocks / 128)); EXECUTE_IF_SET_IN_BITMAP (livein, 0, i, bi) - *tos++ = BASIC_BLOCK (i); + VEC_safe_push (basic_block, heap, worklist, BASIC_BLOCK (i)); /* Iterate until the worklist is empty. */ - while (tos != worklist) + while (! VEC_empty (basic_block, worklist)) { edge e; edge_iterator ei; /* Pull a block off the worklist. */ - bb = *--tos; + basic_block bb = VEC_pop (basic_block, worklist); /* For each predecessor block. */ FOR_EACH_EDGE (e, ei, bb->preds) @@ -437,16 +439,15 @@ compute_global_livein (bitmap livein ATTRIBUTE_UNUSED, bitmap def_blocks ATTRIBU /* None of this is necessary for the entry block. */ if (pred != ENTRY_BLOCK_PTR - && ! bitmap_bit_p (livein, pred_index) - && ! bitmap_bit_p (def_blocks, pred_index)) + && ! bitmap_bit_p (def_blocks, pred_index) + && bitmap_set_bit (livein, pred_index)) { - *tos++ = pred; - bitmap_set_bit (livein, pred_index); + VEC_safe_push (basic_block, heap, worklist, pred); } } } - free (worklist); + VEC_free (basic_block, heap, worklist); } |