aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-05-11 18:17:43 +0000
committerJakub Jelinek <jakub@redhat.com>2010-05-11 18:17:43 +0000
commit553134b40559f99b27bb45c024a2486fd4398217 (patch)
tree1cb4796f120b34f94f9e016946901fdcba7136f8 /gcc/cfgcleanup.c
parent85256ab9dd280af60ac5cc888ab595086e36c053 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@159288 138bc75d-0d04-0410-961f-82ee72b054a4
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;