diff options
author | Jan Hubicka <jh@suse.cz> | 2001-11-14 20:36:17 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2001-11-14 19:36:17 +0000 |
commit | 497786446ba35ea6814862bcd76851e1379653ab (patch) | |
tree | 8373fb038b6e57cf4216b741d08ffb702752c650 /gcc/cfglayout.c | |
parent | 852d3dad0dc7b0ed7144b1409393997830eab8d2 (diff) | |
download | gcc-497786446ba35ea6814862bcd76851e1379653ab.zip gcc-497786446ba35ea6814862bcd76851e1379653ab.tar.gz gcc-497786446ba35ea6814862bcd76851e1379653ab.tar.bz2 |
cfglayout.c (fixup_fallthru_exit_predecesor): New static function.
* cfglayout.c (fixup_fallthru_exit_predecesor): New static function.
(cfg_layout_finalize): Use it.
* bb-reorder.c (HAVE_epilogue): Remove.
(make_reorder_chain): Do not care special placement of
last basic block.
* predict.c (expected_value_to_br_prob): Delete the note
once transformed.
* c-decl.c (c_expand_body): Fix TV_EXPAND nesting problem;
measure integration time separately.
From-SVN: r47019
Diffstat (limited to 'gcc/cfglayout.c')
-rw-r--r-- | gcc/cfglayout.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c index 5c2ee08..d93d44f 100644 --- a/gcc/cfglayout.c +++ b/gcc/cfglayout.c @@ -110,6 +110,7 @@ static rtx get_next_bb_note PARAMS ((rtx)); static rtx get_prev_bb_note PARAMS ((rtx)); void verify_insn_chain PARAMS ((void)); +static basic_block fixup_fallthru_exit_predecesor PARAMS ((void)); /* Skip over inter-block insns occurring after BB which are typically associated with BB (e.g., barriers). If there are any such insns, @@ -1041,6 +1042,30 @@ verify_insn_chain () abort (); } } + +/* The block falling trought to exit must be last in the reordered + chain. Make it happen so. */ +static basic_block +fixup_fallthru_exit_predecesor () +{ + edge e; + basic_block bb = NULL; + + for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next) + if (e->flags & EDGE_FALLTHRU) + bb = e->src; + if (bb && RBI (bb)->next) + { + basic_block c = BASIC_BLOCK (0); + while (RBI (c)->next != bb) + c = RBI (c)->next; + RBI (c)->next = RBI (bb)->next; + while (RBI (c)->next) + c = RBI (c)->next; + RBI (c)->next = bb; + RBI (bb)->next = NULL; + } +} /* Main entry point to this module - initialize the datastructures for CFG layout changes. */ @@ -1062,6 +1087,7 @@ cfg_layout_initialize () void cfg_layout_finalize () { + fixup_fallthru_exit_predecesor (); fixup_reorder_chain (); #ifdef ENABLE_CHECKING verify_insn_chain (); |