diff options
author | mkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-16 06:57:59 +0000 |
---|---|---|
committer | mkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-16 06:57:59 +0000 |
commit | 5d65a39c75e476e21bfd633960e6d45029c6acd2 (patch) | |
tree | e42fd46715b58df86d89a5108120bf34ad75b583 /gcc/cfgrtl.c | |
parent | cada167060726e14f526e246a3d1a7578b3172c1 (diff) | |
download | gcc-5d65a39c75e476e21bfd633960e6d45029c6acd2.tar.gz |
2006-11-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
PR target/29201
* cfgrtl.c (rtl_delete_block): Move the code for getting last insn of
bb to ...
(get_last_bb_insn): ... new global function.
(basic_block.h): Declare it.
* haifa-sched.c (create_recovery_block): Use it.
2006-11-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
PR target/29201
* gcc.c-torture/compile/pr29201.c: New test for ia64 target.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118882 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r-- | gcc/cfgrtl.c | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 0edad6a1af3..3934d9297df 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -361,7 +361,7 @@ cfg_layout_create_basic_block (void *head, void *end, basic_block after) static void rtl_delete_block (basic_block b) { - rtx insn, end, tmp; + rtx insn, end; /* If the head of this block is a CODE_LABEL, then it might be the label for an exception handler which can't be reached. We need @@ -370,18 +370,7 @@ rtl_delete_block (basic_block b) if (LABEL_P (insn)) maybe_remove_eh_handler (insn); - /* Include any jump table following the basic block. */ - end = BB_END (b); - if (tablejump_p (end, NULL, &tmp)) - end = tmp; - - /* Include any barriers that may follow the basic block. */ - tmp = next_nonnote_insn (end); - while (tmp && BARRIER_P (tmp)) - { - end = tmp; - tmp = next_nonnote_insn (end); - } + end = get_last_bb_insn (b); /* Selectively delete the entire chain. */ BB_HEAD (b) = NULL; @@ -1704,6 +1693,29 @@ update_br_prob_note (basic_block bb) return; XEXP (note, 0) = GEN_INT (BRANCH_EDGE (bb)->probability); } + +/* Get the last insn associated with block BB (that includes barriers and + tablejumps after BB). */ +rtx +get_last_bb_insn (basic_block bb) +{ + rtx tmp; + rtx end = BB_END (bb); + + /* Include any jump table following the basic block. */ + if (tablejump_p (end, NULL, &tmp)) + end = tmp; + + /* Include any barriers that may follow the basic block. */ + tmp = next_nonnote_insn (end); + while (tmp && BARRIER_P (tmp)) + { + end = tmp; + tmp = next_nonnote_insn (end); + } + + return end; +} /* Verify the CFG and RTL consistency common for both underlying RTL and cfglayout RTL. |