summaryrefslogtreecommitdiff
path: root/gcc/cfglayout.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-11 18:17:43 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-11 18:17:43 +0000
commitdcb172b4aee2541920b5793aa338e40824f521b4 (patch)
tree1cb4796f120b34f94f9e016946901fdcba7136f8 /gcc/cfglayout.c
parent6834c43a3100068ce10f4b1b60c5bbb486e2a353 (diff)
downloadgcc-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/cfglayout.c')
-rw-r--r--gcc/cfglayout.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index 9d23b16c116..7ba289f1a58 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -1,5 +1,5 @@
/* Basic block reordering routines for the GNU compiler.
- Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
@@ -861,8 +861,11 @@ fixup_reorder_chain (void)
}
else if (extract_asm_operands (PATTERN (bb_end_insn)) != NULL)
{
- /* If the old fallthru is still next, nothing to do. */
- if (bb->aux == e_fall->dest
+ /* If the old fallthru is still next or if
+ asm goto doesn't have a fallthru (e.g. when followed by
+ __builtin_unreachable ()), nothing to do. */
+ if (! e_fall
+ || bb->aux == e_fall->dest
|| e_fall->dest == EXIT_BLOCK_PTR)
continue;