aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfglayout.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/cfglayout.c
parent3895ec538abb365483f1ff862f1fe0e78a3119d5 (diff)
downloadgcc-3b5fda81f9c543ca8bccf438a74a0cb5b54f6a70.zip
gcc-3b5fda81f9c543ca8bccf438a74a0cb5b54f6a70.tar.gz
gcc-3b5fda81f9c543ca8bccf438a74a0cb5b54f6a70.tar.bz2
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/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 9d23b16..7ba289f 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;