Bug 55277 - [4.8 regression] ICE in assign_by_spills, at lra-assigns.c:1217
Summary: [4.8 regression] ICE in assign_by_spills, at lra-assigns.c:1217
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ra
Depends on: 32647
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-11 21:32 UTC by Steven Bosscher
Modified: 2021-12-24 21:02 UTC (History)
9 users (show)

See Also:
Host:
Target: ix86-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-11-11 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Bosscher 2012-11-11 21:32:38 UTC
+++ 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.
Comment 1 Antoine Balestrat 2012-11-24 22:20:46 UTC
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.
Comment 2 Vladimir Makarov 2012-11-26 18:08:50 UTC
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
Comment 3 Richard Biener 2012-12-07 09:45:07 UTC
Fixed I assume.