summaryrefslogtreecommitdiff
path: root/gcc/cfgbuild.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-06 14:46:34 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-06 14:46:34 +0000
commit39257eb5672ddccb54a5527dafc85fc8522f8aa8 (patch)
tree83547529d1afe3a91257ca4399bfb3001703c6a9 /gcc/cfgbuild.c
parenteb7d9cdc889a5abede7c7927d707882401f04654 (diff)
downloadgcc-39257eb5672ddccb54a5527dafc85fc8522f8aa8.tar.gz
* haifa-sched.c (restore_bb_notes): Clear bb field of the notes
emited outside of basic block. * cfgbuild.c (find_bb_boundaries): Clear bb field for insns between the created blocks. * rtl.h (delete_insn_chain): Declaration changed. * cfgrtl.c (delete_insn_chain): Add option to clear bb field for non-removed insns. (rtl_delete_block, rtl_merge_blocks): Pass true to delete_insn_chain. (delete_insn_chain_and_edges, try_redirect_by_replacing_jump, rtl_tidy_fallthru_edge, cfg_layout_merge_blocks): Pass false to delete_insn_chain. (rtl_verify_flow_info_1): Verify that the insns in header and footer do not have bb field set. (rtl_verify_flow_info): Verify that insns between basic blocks do not have bb field set. * recog.c (peephole2_optimize): Add argument to delete_insn_chain call. * cfgcleanup.c (try_optimize_cfg): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125492 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgbuild.c')
-rw-r--r--gcc/cfgbuild.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index e564e8b89e3..cb216afa2c7 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -630,7 +630,7 @@ find_bb_boundaries (basic_block bb)
{
basic_block orig_bb = bb;
rtx insn = BB_HEAD (bb);
- rtx end = BB_END (bb);
+ rtx end = BB_END (bb), x;
rtx table;
rtx flow_transfer_insn = NULL_RTX;
edge fallthru = NULL;
@@ -651,7 +651,16 @@ find_bb_boundaries (basic_block bb)
{
fallthru = split_block (bb, PREV_INSN (insn));
if (flow_transfer_insn)
- BB_END (bb) = flow_transfer_insn;
+ {
+ BB_END (bb) = flow_transfer_insn;
+
+ /* Clean up the bb field for the insns between the blocks. */
+ for (x = NEXT_INSN (flow_transfer_insn);
+ x != BB_HEAD (fallthru->dest);
+ x = NEXT_INSN (x))
+ if (!BARRIER_P (x))
+ set_block_for_insn (x, NULL);
+ }
bb = fallthru->dest;
remove_edge (fallthru);
@@ -666,6 +675,14 @@ find_bb_boundaries (basic_block bb)
{
fallthru = split_block (bb, PREV_INSN (insn));
BB_END (bb) = flow_transfer_insn;
+
+ /* Clean up the bb field for the insns between the blocks. */
+ for (x = NEXT_INSN (flow_transfer_insn);
+ x != BB_HEAD (fallthru->dest);
+ x = NEXT_INSN (x))
+ if (!BARRIER_P (x))
+ set_block_for_insn (x, NULL);
+
bb = fallthru->dest;
remove_edge (fallthru);
flow_transfer_insn = NULL_RTX;
@@ -682,7 +699,18 @@ find_bb_boundaries (basic_block bb)
return and barrier, or possibly other sequence not behaving like
ordinary jump, we need to take care and move basic block boundary. */
if (flow_transfer_insn)
- BB_END (bb) = flow_transfer_insn;
+ {
+ BB_END (bb) = flow_transfer_insn;
+
+ /* Clean up the bb field for the insns that do not belong to BB. */
+ x = flow_transfer_insn;
+ while (x != end)
+ {
+ x = NEXT_INSN (x);
+ if (!BARRIER_P (x))
+ set_block_for_insn (x, NULL);
+ }
+ }
/* We've possibly replaced the conditional jump by conditional jump
followed by cleanup at fallthru edge, so the outgoing edges may