diff options
Diffstat (limited to 'gcc/cfgbuild.c')
-rw-r--r-- | gcc/cfgbuild.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c index 453e65c..f5bf3e8 100644 --- a/gcc/cfgbuild.c +++ b/gcc/cfgbuild.c @@ -251,8 +251,9 @@ make_edges (basic_block min, basic_block max, int update_p) FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb) { edge e; + edge_iterator ei; - for (e = bb->succ; e ; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) if (e->dest != EXIT_BLOCK_PTR) SET_BIT (edge_cache[bb->index], e->dest->index); } @@ -270,6 +271,7 @@ make_edges (basic_block min, basic_block max, int update_p) enum rtx_code code; int force_fallthru = 0; edge e; + edge_iterator ei; if (LABEL_P (BB_HEAD (bb)) && LABEL_ALT_ENTRY_P (BB_HEAD (bb))) @@ -388,7 +390,7 @@ make_edges (basic_block min, basic_block max, int update_p) /* Find out if we can drop through to the next block. */ insn = NEXT_INSN (insn); - for (e = bb->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, bb->succs) if (e->dest == EXIT_BLOCK_PTR && e->flags & EDGE_FALLTHRU) { insn = 0; @@ -640,8 +642,9 @@ static void compute_outgoing_frequencies (basic_block b) { edge e, f; + edge_iterator ei; - if (b->succ && b->succ->succ_next && !b->succ->succ_next->succ_next) + if (EDGE_COUNT (b->succs) == 2) { rtx note = find_reg_note (BB_END (b), REG_BR_PROB, NULL); int probability; @@ -660,16 +663,16 @@ compute_outgoing_frequencies (basic_block b) } } - if (b->succ && !b->succ->succ_next) + if (EDGE_COUNT (b->succs) == 1) { - e = b->succ; + e = EDGE_SUCC (b, 0); e->probability = REG_BR_PROB_BASE; e->count = b->count; return; } guess_outgoing_edge_probabilities (b); if (b->count) - for (e = b->succ; e; e = e->succ_next) + FOR_EACH_EDGE (e, ei, b->succs) e->count = ((b->count * e->probability + REG_BR_PROB_BASE / 2) / REG_BR_PROB_BASE); } @@ -709,6 +712,7 @@ find_many_sub_basic_blocks (sbitmap blocks) FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb) { edge e; + edge_iterator ei; if (STATE (bb) == BLOCK_ORIGINAL) continue; @@ -716,7 +720,7 @@ find_many_sub_basic_blocks (sbitmap blocks) { bb->count = 0; bb->frequency = 0; - for (e = bb->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, bb->preds) { bb->count += e->count; bb->frequency += EDGE_FREQUENCY (e); @@ -751,12 +755,13 @@ find_sub_basic_blocks (basic_block bb) FOR_BB_BETWEEN (b, min, max->next_bb, next_bb) { edge e; + edge_iterator ei; if (b != min) { b->count = 0; b->frequency = 0; - for (e = b->pred; e; e = e->pred_next) + FOR_EACH_EDGE (e, ei, b->preds) { b->count += e->count; b->frequency += EDGE_FREQUENCY (e); |