aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-04-12 09:27:25 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2019-04-12 09:27:25 +0200
commitc758576accc3eef33c31766352453b0ad1953569 (patch)
tree09b36de5d1d2ef17d03c90b6b08477d3813c0852 /gcc/cfgcleanup.c
parentdf63d1b7f755a38d3f762899c91d48f893091088 (diff)
downloadgcc-c758576accc3eef33c31766352453b0ad1953569.zip
gcc-c758576accc3eef33c31766352453b0ad1953569.tar.gz
gcc-c758576accc3eef33c31766352453b0ad1953569.tar.bz2
re PR rtl-optimization/90026 (ICE: verify_flow_info failed (error: missing barrier after block 2))
PR rtl-optimization/90026 * cfgcleanup.c (try_optimize_cfg): When removing empty bb with no successors, look for BARRIERs inside of the whole BB_FOOTER chain rather than just at the start of it. If e->src BB_FOOTER is not NULL in cfglayout mode, use emit_barrier_after_bb. * g++.dg/opt/pr90026.C: New test. From-SVN: r270304
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 86b2627..992912c 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -2712,23 +2712,23 @@ try_optimize_cfg (int mode)
if (current_ir_type () == IR_RTL_CFGLAYOUT)
{
- if (BB_FOOTER (b)
- && BARRIER_P (BB_FOOTER (b)))
+ rtx_insn *insn;
+ for (insn = BB_FOOTER (b);
+ insn; insn = NEXT_INSN (insn))
+ if (BARRIER_P (insn))
+ break;
+ if (insn)
FOR_EACH_EDGE (e, ei, b->preds)
- if ((e->flags & EDGE_FALLTHRU)
- && BB_FOOTER (e->src) == NULL)
+ if ((e->flags & EDGE_FALLTHRU))
{
- if (BB_FOOTER (b))
+ if (BB_FOOTER (b)
+ && BB_FOOTER (e->src) == NULL)
{
BB_FOOTER (e->src) = BB_FOOTER (b);
BB_FOOTER (b) = NULL;
}
else
- {
- start_sequence ();
- BB_FOOTER (e->src) = emit_barrier ();
- end_sequence ();
- }
+ emit_barrier_after_bb (e->src);
}
}
else