summaryrefslogtreecommitdiff
path: root/gcc/sched-ebb.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/sched-ebb.c')
-rw-r--r--gcc/sched-ebb.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c
index 5f1464b9c14..67f88844378 100644
--- a/gcc/sched-ebb.c
+++ b/gcc/sched-ebb.c
@@ -279,11 +279,11 @@ void
schedule_ebbs (dump_file)
FILE *dump_file;
{
- int i;
+ basic_block bb;
/* Taking care of this degenerate case makes the rest of
this code simpler. */
- if (n_basic_blocks == 0)
+ if (num_basic_blocks == 0)
return;
scope_to_insns_initialize ();
@@ -296,20 +296,19 @@ schedule_ebbs (dump_file)
compute_bb_for_insn (get_max_uid ());
/* Schedule every region in the subroutine. */
- for (i = 0; i < n_basic_blocks; i++)
- {
- rtx head = BASIC_BLOCK (i)->head;
+ FOR_ALL_BB (bb)
+ {
+ rtx head = bb->head;
rtx tail;
for (;;)
{
- basic_block b = BASIC_BLOCK (i);
edge e;
- tail = b->end;
- if (i + 1 == n_basic_blocks
- || GET_CODE (BLOCK_HEAD (i + 1)) == CODE_LABEL)
+ tail = bb->end;
+ if (bb->next_bb == EXIT_BLOCK_PTR
+ || GET_CODE (bb->next_bb->head) == CODE_LABEL)
break;
- for (e = b->succ; e; e = e->succ_next)
+ for (e = bb->succ; e; e = e->succ_next)
if ((e->flags & EDGE_FALLTHRU) != 0)
break;
if (! e)
@@ -325,7 +324,7 @@ schedule_ebbs (dump_file)
}
}
- i++;
+ bb = bb->next_bb;
}
/* Blah. We should fix the rest of the code not to get confused by