diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-11 18:17:43 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-11 18:17:43 +0000 |
commit | dcb172b4aee2541920b5793aa338e40824f521b4 (patch) | |
tree | 1cb4796f120b34f94f9e016946901fdcba7136f8 /gcc/cfgcleanup.c | |
parent | 6834c43a3100068ce10f4b1b60c5bbb486e2a353 (diff) | |
download | gcc-dcb172b4aee2541920b5793aa338e40824f521b4.tar.gz |
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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159288 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r-- | gcc/cfgcleanup.c | 19 |
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; |