This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/51592] New: ICE with -fnon-call-exceptions
- From: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 16 Dec 2011 22:30:54 +0000
- Subject: [Bug middle-end/51592] New: ICE with -fnon-call-exceptions
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51592
Bug #: 51592
Summary: ICE with -fnon-call-exceptions
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: ian@airs.com
Compile this C program with -O -fexceptions -fnon-call-exceptions:
extern void f2 () __attribute__ ((noreturn));
void
f1 ()
{
unsigned char a[8];
unsigned int i;
for (i = 0; i < 8; i++)
{
if (i > 8)
f2 ();
a[i] = i <= 8;
}
}
With current mainline I get an ICE:
foo.c: In function âf1â:
foo.c:3:1: error: statement marked for throw, but doesnât
# .MEM_17 = VDEF <.MEM_8(D)>
a[0] = D.1714_10;
foo.c:3:1: internal compiler error: verify_gimple failed
The basic problem is that the compiler thinks that a[i] can trap, and because
we are using -fnon-call-exceptions, it sets up an exception region for it.
When the loop is unrolled, the statement changes from a[i] to a[0]. The
compiler knows that a[0] can not trap, but the statement is still in the
exception region.