extern void foo (void) __attribute__ ((__noreturn__)); void bar (int x) { if (x < 0) foo (); if (x == 0) return; __asm goto ("" : : : : lab); lab:; } ICEs on x86_64-linux: LC_ALL=C ./cc1 -O2 rh829247.c -quiet rh829247.c: In function 'bar': rh829247.c:12:1: internal compiler error: in maybe_record_trace_start, at dwarf2cfi.c:2193 } ^ Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. The problem is that we end up with asm goto that branches to the fallthru label and shrink-wrapping wants to redirect the edge, but leaves broken CFG around.
Started with -fshrink-wrap addition http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179553
Created attachment 27562 [details] gcc48-pr53589.patch Untested fix.
Author: jakub Date: Tue Jun 12 07:52:47 2012 New Revision: 188428 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188428 Log: PR rtl-optimization/53589 * cfgrtl.c (force_nonfallthru_and_redirect): Do asm_goto_edge discovery even when e->dest != target. If any LABEL_REF points to e->dest label, redirect it to target's label. * gcc.dg/torture/pr53589.c: New test. Added: trunk/gcc/testsuite/gcc.dg/torture/pr53589.c Modified: trunk/gcc/ChangeLog trunk/gcc/cfgrtl.c trunk/gcc/testsuite/ChangeLog
GCC 4.7.1 is being released, adjusting target milestone.
Author: jakub Date: Thu Jun 14 17:49:49 2012 New Revision: 188626 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188626 Log: Backported from mainline 2012-06-12 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/53589 * cfgrtl.c (force_nonfallthru_and_redirect): Do asm_goto_edge discovery even when e->dest != target. If any LABEL_REF points to e->dest label, redirect it to target's label. * gcc.dg/torture/pr53589.c: New test. Added: branches/gcc-4_7-branch/gcc/testsuite/gcc.dg/torture/pr53589.c Modified: branches/gcc-4_7-branch/gcc/ChangeLog branches/gcc-4_7-branch/gcc/cfgrtl.c branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
Fixed.