summaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-05-11 20:17:43 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2010-05-11 20:17:43 +0200
commit3b5fda81f9c543ca8bccf438a74a0cb5b54f6a70 (patch)
tree1cb4796f120b34f94f9e016946901fdcba7136f8 /gcc/cfgcleanup.c
parent3895ec538abb365483f1ff862f1fe0e78a3119d5 (diff)
downloadgcc-3b5fda81f9c543ca8bccf438a74a0cb5b54f6a70.tar.gz
re PR middle-end/44071 (ICE with asm goto and __builtin_unreachable())
PR middle-end/44071 * cfglayout.c (fixup_reorder_chain): Allow asm goto to have no fallthru edge. * cfgcleanup.c (try_optimize_cfg): When in cfglayout mode optimizing away empty bb with no successors, move over its footer chain to fallthru predecessor. * cfgrtl.c (patch_jump_insn): Update also REG_LABEL_OPERAND. (rtl_split_edge): For asm goto call patch_jump_insn even if splitting fallthru edge. * c-c++-common/asmgoto-4.c: New test. * gcc.target/i386/pr44071.c: New test. From-SVN: r159288
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index dc6c245b950..75f56519a26 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1999,6 +1999,25 @@ try_optimize_cfg (int mode)
&& single_succ_edge (ENTRY_BLOCK_PTR)->dest != b))
{
c = b->prev_bb;
+ if ((mode & CLEANUP_CFGLAYOUT)
+ && EDGE_COUNT (b->preds) > 0
+ && b->il.rtl->footer
+ && BARRIER_P (b->il.rtl->footer))
+ {
+ edge e;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, b->preds)
+ if (e->flags & EDGE_FALLTHRU)
+ {
+ if (e->src->il.rtl->footer == NULL)
+ {
+ e->src->il.rtl->footer = b->il.rtl->footer;
+ b->il.rtl->footer = NULL;
+ }
+ break;
+ }
+ }
delete_basic_block (b);
if (!(mode & CLEANUP_CFGLAYOUT))
changed = true;