summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-17 13:02:31 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-17 13:02:31 +0000
commitfc2596c8b958ac6626601b8dd7e5ba25fc64f006 (patch)
tree1e89d1229ecf0cb5ad8729761520910b3d4127b2 /gcc/combine.c
parent0e0023ea90f853550206854d1c71a923bcc91fa2 (diff)
downloadgcc-fc2596c8b958ac6626601b8dd7e5ba25fc64f006.tar.gz
PR rtl-optimization/46440
* combine.c (update_cfg_for_uncondjump): When changing an indirect jump into unconditional jump, remove BARRIERs from bb's footer. * gcc.dg/pr46440.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166867 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index d55ce3127d8..c557e8c65c8 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -2460,7 +2460,25 @@ update_cfg_for_uncondjump (rtx insn)
delete_insn (insn);
if (at_end && EDGE_COUNT (bb->succs) == 1)
- single_succ_edge (bb)->flags |= EDGE_FALLTHRU;
+ {
+ rtx insn;
+
+ single_succ_edge (bb)->flags |= EDGE_FALLTHRU;
+
+ /* Remove barriers from the footer if there are any. */
+ for (insn = bb->il.rtl->footer; insn; insn = NEXT_INSN (insn))
+ if (BARRIER_P (insn))
+ {
+ if (PREV_INSN (insn))
+ NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn);
+ else
+ bb->il.rtl->footer = NEXT_INSN (insn);
+ if (NEXT_INSN (insn))
+ PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn);
+ }
+ else if (LABEL_P (insn))
+ break;
+ }
}
/* Try to combine the insns I0, I1 and I2 into I3.