diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-16 17:34:53 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-16 17:34:53 +0000 |
commit | 4c5da23833f4604c04fb829abf1a39ab6976e7b2 (patch) | |
tree | 47d672ee2344eb156d43b4e6fc935c02ed904ce7 /gcc/bb-reorder.c | |
parent | 14abf9235794ba37b9ad3ef6381ad36c3606370d (diff) | |
download | gcc-4c5da23833f4604c04fb829abf1a39ab6976e7b2.tar.gz |
Basic block renumbering removal.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53522 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r-- | gcc/bb-reorder.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index 3647ad6ec4b..06212bc108c 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -102,14 +102,11 @@ static void make_reorder_chain () { basic_block prev = NULL; - int nbb_m1 = n_basic_blocks - 1; - basic_block next; + basic_block next, bb; /* Loop until we've placed every block. */ do { - int i; - next = NULL; /* Find the next unplaced block. */ @@ -119,12 +116,13 @@ make_reorder_chain () remove from the list as we place. The head of that list is what we're looking for here. */ - for (i = 0; i <= nbb_m1 && !next; ++i) - { - basic_block bb = BASIC_BLOCK (i); - if (! RBI (bb)->visited) + FOR_ALL_BB (bb) + if (! RBI (bb)->visited) + { next = bb; - } + break; + } + if (next) prev = make_reorder_chain_1 (next, prev); } @@ -158,13 +156,13 @@ make_reorder_chain_1 (bb, prev) restart: RBI (prev)->next = bb; - if (rtl_dump_file && prev->index + 1 != bb->index) + if (rtl_dump_file && prev->next_bb != bb) fprintf (rtl_dump_file, "Reordering block %d after %d\n", - bb->index, prev->index); + bb->sindex, prev->sindex); } else { - if (bb->index != 0) + if (bb->prev_bb != ENTRY_BLOCK_PTR) abort (); } RBI (bb)->visited = 1; @@ -214,7 +212,7 @@ make_reorder_chain_1 (bb, prev) if (! next) { for (e = bb->succ; e ; e = e->succ_next) - if (e->dest->index == bb->index + 1) + if (e->dest == bb->next_bb) { if ((e->flags & EDGE_FALLTHRU) || (e->dest->succ @@ -258,7 +256,7 @@ make_reorder_chain_1 (bb, prev) void reorder_basic_blocks () { - if (n_basic_blocks <= 1) + if (num_basic_blocks <= 1) return; if ((* targetm.cannot_modify_jumps_p) ()) |