summaryrefslogtreecommitdiff
path: root/gcc/loop-init.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/loop-init.c')
-rw-r--r--gcc/loop-init.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/loop-init.c b/gcc/loop-init.c
index 35fa12ea3e6..8db45ec0e40 100644
--- a/gcc/loop-init.c
+++ b/gcc/loop-init.c
@@ -35,6 +35,7 @@ loop_optimizer_init (FILE *dumpfile)
{
struct loops *loops = xcalloc (1, sizeof (struct loops));
edge e;
+ edge_iterator ei;
static bool first_time = true;
if (first_time)
@@ -45,9 +46,12 @@ loop_optimizer_init (FILE *dumpfile)
/* Avoid annoying special cases of edges going to exit
block. */
- for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
- if ((e->flags & EDGE_FALLTHRU) && e->src->succ->succ_next)
+
+ for (ei = ei_start (EXIT_BLOCK_PTR->preds); (e = ei_safe_edge (ei)); )
+ if ((e->flags & EDGE_FALLTHRU) && EDGE_COUNT (e->src->succs) > 1)
split_edge (e);
+ else
+ ei_next (&ei);
/* Find the loops. */