diff options
Diffstat (limited to 'gcc/ssa-ccp.c')
-rw-r--r-- | gcc/ssa-ccp.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/gcc/ssa-ccp.c b/gcc/ssa-ccp.c index 641727655ba..be1b0dd2b02 100644 --- a/gcc/ssa-ccp.c +++ b/gcc/ssa-ccp.c @@ -648,13 +648,13 @@ examine_flow_edges () /* If this is the first time we've simulated this block, then we must simulate each of its insns. */ - if (!TEST_BIT (executable_blocks, succ_block->index)) + if (!TEST_BIT (executable_blocks, succ_block->sindex)) { rtx currinsn; edge succ_edge = succ_block->succ; /* Note that we have simulated this block. */ - SET_BIT (executable_blocks, succ_block->index); + SET_BIT (executable_blocks, succ_block->sindex); /* Simulate each insn within the block. */ currinsn = succ_block->head; @@ -740,6 +740,7 @@ optimize_unexecutable_edges (edges, executable_edges) sbitmap executable_edges; { int i; + basic_block bb; for (i = 0; i < NUM_EDGES (edges); i++) { @@ -761,15 +762,15 @@ optimize_unexecutable_edges (edges, executable_edges) remove_phi_alternative (PATTERN (insn), edge->src); if (rtl_dump_file) fprintf (rtl_dump_file, - "Removing alternative for bb %d of phi %d\n", - edge->src->index, SSA_NAME (PATTERN (insn))); + "Removing alternative for bb %d of phi %d\n", + edge->src->sindex, SSA_NAME (PATTERN (insn))); insn = NEXT_INSN (insn); } } if (rtl_dump_file) fprintf (rtl_dump_file, "Removing unexecutable edge from %d to %d\n", - edge->src->index, edge->dest->index); + edge->src->sindex, edge->dest->sindex); /* Since the edge was not executable, remove it from the CFG. */ remove_edge (edge); } @@ -797,9 +798,8 @@ optimize_unexecutable_edges (edges, executable_edges) In cases B & C we are removing uses of registers, so make sure to note those changes for the DF analyzer. */ - for (i = 0; i < n_basic_blocks; i++) + FOR_ALL_BB (bb) { - basic_block bb = BASIC_BLOCK (i); rtx insn = bb->end; edge edge = bb->succ; @@ -929,7 +929,7 @@ ssa_ccp_substitute_constants () static void ssa_ccp_df_delete_unreachable_insns () { - int i; + basic_block b; /* Use the CFG to find all the reachable blocks. */ find_unreachable_blocks (); @@ -937,10 +937,8 @@ ssa_ccp_df_delete_unreachable_insns () /* Now we know what blocks are not reachable. Mark all the insns in those blocks as deleted for the DF analyzer. We'll let the normal flow code actually remove the unreachable blocks. */ - for (i = n_basic_blocks - 1; i >= 0; --i) + FOR_ALL_BB_REVERSE (b) { - basic_block b = BASIC_BLOCK (i); - if (!(b->flags & BB_REACHABLE)) { rtx start = b->head; @@ -1018,7 +1016,7 @@ ssa_const_prop () ssa_edges = sbitmap_alloc (VARRAY_SIZE (ssa_definition)); sbitmap_zero (ssa_edges); - executable_blocks = sbitmap_alloc (n_basic_blocks); + executable_blocks = sbitmap_alloc (last_basic_block); sbitmap_zero (executable_blocks); executable_edges = sbitmap_alloc (NUM_EDGES (edges)); |