summaryrefslogtreecommitdiff
path: root/gcc/cfgbuild.c
diff options
context:
space:
mode:
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);