diff options
author | Richard Henderson <rth@gcc.gnu.org> | 2000-04-17 18:32:43 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-04-17 18:32:43 -0700 |
commit | d1bfc5ad4635db1d58d8233f7803b26ba2378647 (patch) | |
tree | 82f503a04671608956729a620929f00c37cfac07 /gcc/bb-reorder.c | |
parent | 009e98457a3f7b1603422123052eeddb83dd5070 (diff) | |
download | gcc-d1bfc5ad4635db1d58d8233f7803b26ba2378647.zip gcc-d1bfc5ad4635db1d58d8233f7803b26ba2378647.tar.gz gcc-d1bfc5ad4635db1d58d8233f7803b26ba2378647.tar.bz2 |
bb-reorder.c (fixup_reorder_chain): Don't look up new block again.
* bb-reorder.c (fixup_reorder_chain): Don't look up new block again.
(reorder_basic_blocks): If no epilogue in rtl, force last block last.
From-SVN: r33221
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r-- | gcc/bb-reorder.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index e2f40f1..5f2e178 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -690,8 +690,7 @@ fixup_reorder_chain () BASIC_BLOCK (nb->index)->local_set = 0; nb->aux = xcalloc (1, sizeof (struct reorder_block_def)); - REORDER_BLOCK_INDEX (BASIC_BLOCK (n_basic_blocks - 1)) - = REORDER_BLOCK_INDEX (bbi) + 1; + REORDER_BLOCK_INDEX (nb) = REORDER_BLOCK_INDEX (bbi) + 1; /* Relink to new block. */ nb->succ = bbi->succ; nb->succ->src = nb; @@ -835,6 +834,22 @@ reorder_basic_blocks () REORDER_BLOCK_EFF_HEAD (bbi) = NEXT_INSN (prev_eff_end); } } + + /* If we've not got epilogue in RTL, we must fallthru to the exit. + Force the last block to be at the end. */ + /* ??? Some ABIs (e.g. MIPS) require the return insn to be at the + end of the function for stack unwinding purposes. */ + +#ifndef HAVE_epilogue +#define HAVE_epilogue 0 +#endif + + if (! HAVE_epilogue) + { + basic_block last = BASIC_BLOCK (n_basic_blocks - 1); + REORDER_BLOCK_INDEX (last) = n_basic_blocks - 1; + REORDER_BLOCK_FLAGS (last) |= REORDER_BLOCK_VISITED; + } make_reorder_chain (BASIC_BLOCK (0)); |