+++ This bug was initially created as a clone of Bug #42536 +++ Cloned for LRA. /* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ /* { dg-options "-O2 -fno-gcse -fno-omit-frame-pointer -m32" } */ struct C; struct B { struct C *b; }; struct C { void (*baz) (struct B *, void *, int); }; typedef union { int f; void *e; } D; struct E { struct B *e; }; struct A { struct E *a1; D *a2; D *a3; }; void foo (long *x, long y) { *(long long *) x = y; } extern long fn1 (D); extern void fn2 (void); void _bar (struct A *x) { register int a asm ("esi"); register D *volatile b asm ("edi"); register int c asm ("ebx"); void *d; asm volatile ("" : "=r" (a), "=r" (b), "=r" (c) : : "memory"); if ((d = b[-2].e) != 0 && b [-2].e < d) { foo (&(((long *) d) + 1) [b[0].f], fn1 (b[-1])); x->a2 = (D *) c; x->a3 = b; fn2 (); } x->a1->e->b->baz (x->a1->e, (void *) (long) a, 1); } At trunk r193411: t.c: In function '_bar': t.c:36:1: internal compiler error: in assign_by_spills, at lra-assigns.c:1217 } ^ 0x8d6d6f assign_by_spills ../../trunk/gcc/lra-assigns.c:1217 0x8d7ab5 lra_assign() ../../trunk/gcc/lra-assigns.c:1369 0x8d2942 lra(_IO_FILE*) ../../trunk/gcc/lra.c:2303 0x882ea0 do_reload ../../trunk/gcc/ira.c:4624 0x883089 rest_of_handle_reload ../../trunk/gcc/ira.c:4737 Please submit a full bug report, with preprocessed source if appropriate.
I've got a simpler testcase that seems to trigger the same ICE, if this is of any help. $ cat lra.c int a, c; void f(long long p) { long long b; if(b) b = p ? : 0; for (; p; p++) p *= a & (c = p *= !a < 2); a = b += !(b & 3740917449); } $ xgcc -O1 -m32 -w lra.c lra.c: In function ‘f’: lra.c:14:1: internal compiler error: in assign_by_spills, at lra-assigns.c:1217 } ^ Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
Author: vmakarov Date: Mon Nov 26 18:08:44 2012 New Revision: 193824 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193824 Log: 2012-11-26 Vladimir Makarov <vmakarov@redhat.com> PR target/55277 * gcc.target/i386/pr55227.c: New test. 2012-11-26 Vladimir Makarov <vmakarov@redhat.com> PR target/55277 * lra-constraints.c (in_class_p): Check reg class contents too. Added: trunk/gcc/testsuite/gcc.target/i386/pr55277.c Modified: trunk/gcc/ChangeLog trunk/gcc/lra-constraints.c trunk/gcc/testsuite/ChangeLog
Fixed I assume.