aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-10-21 02:33:33 +0000
committerNathan Froyd <froydnj@codesourcery.com>2010-10-21 02:33:33 +0000
commitfa42c011ac41a6f1405b7c91e762a4ee98517641 (patch)
tree46c04a0ca71f226e6c7a15bdb22ae8bb69768800 /gcc/cfgcleanup.c
parent133312b926e35c321336f9479d3365a0336ed2e0 (diff)
* basic-block.h (find_fallthru_edge): Define.
* cfgcleanup.c (merge_blocks_move): Use it. (try_crossjump_bb): Likewise. * cfglayout.c (fixup_reorder_chains): Likewise. (fixup_fallthru_exit_predecessor): Likewise. * cfgrtl.c (rtl_split_edge): Likewise. (rtl_verify_flow_info): Likewise. * function.c (thread_prologue_and_epilogue_insns): Likewise. * gimple-pretty-print.c (dump_implicit_edges): Likewise. * ifcvt.c (block_fallthru): Likewise. * reload1.c (fixup_abnormal_edges): Likewise. * sched-ebb.c (being_schedule_ready): Likewise. (schedule_ebb): Likwise. * sched-rgn.c (find_single_block_region): Likewise. * sel-sched-ir.c (bb_ends_ebb_p): Likewise. * tree-complex.c (expand_complex_move): Likewise. * sched-int.h (find_fallthru_edge): Rename to... (find_fallthru_edge_from): ...this. * haifa-sched.c (find_fallthru_edge): Rename to... (find_fallthru_edge_from): ...this. Use new find_fallthru_edge. (init_before_recovery): Call find_fallthru_edge_from. * sel-sched-ir.c (merge_fences): Likewise. * sel-sched.c (in_fallthru_bb_p): Likewise. (move_cond_jump): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@165748 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index d28ae6fb0df..9563e3f5567 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -793,7 +793,6 @@ merge_blocks_move (edge e, basic_block b, basic_block c, int mode)
edge tmp_edge, b_fallthru_edge;
bool c_has_outgoing_fallthru;
bool b_has_incoming_fallthru;
- edge_iterator ei;
/* Avoid overactive code motion, as the forwarder blocks should be
eliminated by edge redirection instead. One exception might have
@@ -806,16 +805,10 @@ merge_blocks_move (edge e, basic_block b, basic_block c, int mode)
and loop notes. This is done by squeezing out all the notes
and leaving them there to lie. Not ideal, but functional. */
- FOR_EACH_EDGE (tmp_edge, ei, c->succs)
- if (tmp_edge->flags & EDGE_FALLTHRU)
- break;
-
+ tmp_edge = find_fallthru_edge (c->succs);
c_has_outgoing_fallthru = (tmp_edge != NULL);
- FOR_EACH_EDGE (tmp_edge, ei, b->preds)
- if (tmp_edge->flags & EDGE_FALLTHRU)
- break;
-
+ tmp_edge = find_fallthru_edge (b->preds);
b_has_incoming_fallthru = (tmp_edge != NULL);
b_fallthru_edge = tmp_edge;
next = b->prev_bb;
@@ -1801,7 +1794,6 @@ try_crossjump_bb (int mode, basic_block bb)
bool changed;
unsigned max, ix, ix2;
basic_block ev, ev2;
- edge_iterator ei;
/* Nothing to do if there is not at least two incoming edges. */
if (EDGE_COUNT (bb->preds) < 2)
@@ -1838,14 +1830,7 @@ try_crossjump_bb (int mode, basic_block bb)
if (EDGE_COUNT (bb->preds) > max)
return false;
- FOR_EACH_EDGE (e, ei, bb->preds)
- {
- if (e->flags & EDGE_FALLTHRU)
- {
- fallthru = e;
- break;
- }
- }
+ fallthru = find_fallthru_edge (bb->preds);
changed = false;
for (ix = 0, ev = bb; ix < EDGE_COUNT (ev->preds); )