aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dce.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-dce.c')
-rw-r--r--gcc/tree-ssa-dce.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index dfa719a..735feb18 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -504,7 +504,8 @@ find_obviously_necessary_stmts (struct edge_list *el)
and we currently do not have a means to recognize the finite ones. */
FOR_EACH_BB (bb)
{
- for (e = bb->succ; e; e = e->succ_next)
+ edge_iterator ei;
+ FOR_EACH_EDGE (e, ei, bb->succs)
if (e->flags & EDGE_DFS_BACK)
mark_control_dependent_edges_necessary (e->dest, el);
}
@@ -731,7 +732,6 @@ remove_dead_stmt (block_stmt_iterator *i, basic_block bb)
if (is_ctrl_stmt (t))
{
basic_block post_dom_bb;
- edge e;
/* The post dominance info has to be up-to-date. */
gcc_assert (dom_computed[CDI_POST_DOMINATORS] == DOM_OK);
/* Get the immediate post dominator of bb. */
@@ -746,30 +746,26 @@ remove_dead_stmt (block_stmt_iterator *i, basic_block bb)
}
/* Redirect the first edge out of BB to reach POST_DOM_BB. */
- redirect_edge_and_branch (bb->succ, post_dom_bb);
- PENDING_STMT (bb->succ) = NULL;
- bb->succ->probability = REG_BR_PROB_BASE;
- bb->succ->count = bb->count;
+ redirect_edge_and_branch (EDGE_SUCC (bb, 0), post_dom_bb);
+ PENDING_STMT (EDGE_SUCC (bb, 0)) = NULL;
+ EDGE_SUCC (bb, 0)->probability = REG_BR_PROB_BASE;
+ EDGE_SUCC (bb, 0)->count = bb->count;
/* The edge is no longer associated with a conditional, so it does
not have TRUE/FALSE flags. */
- bb->succ->flags &= ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE);
+ EDGE_SUCC (bb, 0)->flags &= ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE);
/* If the edge reaches any block other than the exit, then it is a
fallthru edge; if it reaches the exit, then it is not a fallthru
edge. */
if (post_dom_bb != EXIT_BLOCK_PTR)
- bb->succ->flags |= EDGE_FALLTHRU;
+ EDGE_SUCC (bb, 0)->flags |= EDGE_FALLTHRU;
else
- bb->succ->flags &= ~EDGE_FALLTHRU;
+ EDGE_SUCC (bb, 0)->flags &= ~EDGE_FALLTHRU;
/* Remove the remaining the outgoing edges. */
- for (e = bb->succ->succ_next; e != NULL;)
- {
- edge tmp = e;
- e = e->succ_next;
- remove_edge (tmp);
- }
+ while (EDGE_COUNT (bb->succs) != 1)
+ remove_edge (EDGE_SUCC (bb, 1));
}
bsi_remove (i);