summaryrefslogtreecommitdiff
path: root/gcc/cfgbuild.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-16 15:04:06 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-16 15:04:06 +0000
commitb80f5ed2b836edc62458ba7eef35899007eeccb9 (patch)
tree00b526e6b0899f2c8935d2bf97966bacb064ecf9 /gcc/cfgbuild.c
parentd865ae6e930f3754f75c0bf914043abd412aaa9d (diff)
downloadgcc-b80f5ed2b836edc62458ba7eef35899007eeccb9.tar.gz
PR middle-end/41360
* cfgbuild.c (find_bb_boundaries): Re-instate 2009-09-02 barrier fix. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151759 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgbuild.c')
-rw-r--r--gcc/cfgbuild.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index b5ddadd2ac9..5744108b5d4 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -477,9 +477,17 @@ find_bb_boundaries (basic_block bb)
if (code == CODE_LABEL && LABEL_ALT_ENTRY_P (insn))
make_edge (ENTRY_BLOCK_PTR, bb, 0);
}
-
- if (control_flow_insn_p (insn))
+ else if (code == BARRIER)
+ {
+ /* __builtin_unreachable () may cause a barrier to be emitted in
+ the middle of a BB. We need to split it in the same manner as
+ if the barrier were preceded by a control_flow_insn_p insn. */
+ if (!flow_transfer_insn)
+ flow_transfer_insn = prev_nonnote_insn_bb (insn);
+ }
+ else if (control_flow_insn_p (insn))
flow_transfer_insn = insn;
+
if (insn == end)
break;
insn = NEXT_INSN (insn);