summaryrefslogtreecommitdiff
path: root/gcc/jump.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-27 09:19:30 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-27 09:19:30 +0000
commite2810e72badff5a22e6f720494e483ce1ee4062f (patch)
tree348fce1e9f815dcfda4c8411fae30e1f49b30857 /gcc/jump.c
parentcf5a1dfcddb97a8ba07e49cb2a6baca232ebbd8d (diff)
downloadgcc-e2810e72badff5a22e6f720494e483ce1ee4062f.tar.gz
PR rtl-optimization/61058
* jump.c (cleanup_barriers): Update basic block boundaries if BLOCK_FOR_INSN is non-NULL on PREV. * gcc.dg/pr61058.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220155 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/jump.c')
-rw-r--r--gcc/jump.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 3b8c91e007f..34b3b7b8932 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -168,7 +168,30 @@ cleanup_barriers (void)
if (BARRIER_P (prev))
delete_insn (insn);
else if (prev != PREV_INSN (insn))
- reorder_insns_nobb (insn, insn, prev);
+ {
+ basic_block bb = BLOCK_FOR_INSN (prev);
+ rtx_insn *end = PREV_INSN (insn);
+ reorder_insns_nobb (insn, insn, prev);
+ if (bb)
+ {
+ /* If the backend called in machine reorg compute_bb_for_insn
+ and didn't free_bb_for_insn again, preserve basic block
+ boundaries. Move the end of basic block to PREV since
+ it is followed by a barrier now, and clear BLOCK_FOR_INSN
+ on the following notes.
+ ??? Maybe the proper solution for the targets that have
+ cfg around after machine reorg is not to run cleanup_barriers
+ pass at all. */
+ BB_END (bb) = prev;
+ do
+ {
+ prev = NEXT_INSN (prev);
+ if (prev != insn && BLOCK_FOR_INSN (prev) == bb)
+ BLOCK_FOR_INSN (prev) = NULL;
+ }
+ while (prev != end);
+ }
+ }
}
}
return 0;