From dcb172b4aee2541920b5793aa338e40824f521b4 Mon Sep 17 00:00:00 2001 From: jakub Date: Tue, 11 May 2010 18:17:43 +0000 Subject: 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 --- gcc/cfglayout.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gcc/cfglayout.c') 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; -- cgit v1.2.1