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