GCC version:
gcc (GCC) 4.0.0 (4.0.0-3mdk for Mandriva Linux release 2006.0)
But also tested with gcc 4.1 CVS 0508
Architecture: ix86
GCC cannot compile the following code when -O2 and -fPIC are used :
static void drawPointsLines (char type, int first, int *dd) {*dd += 1;}
int do_locator (int *call)
{
int *dd = call;
int i = 0, type = 1;
if (call == 0)
for (; i < 2; i++)
dd += type;
else
{
type = *call;
for(; i < 2; i++)
if (type != i)
drawPointsLines (type,0, call);
}
drawPointsLines(type,0,call);
return 0;
}
[EMAIL PROTECTED] ~]$ gcc -c -O2 -fPIC gccbug.c
gccbug.c: In function 'do_locator':
gccbug.c:19: error: unable to find a register to spill in class 'Q_REGS'
gccbug.c:19: error: this is the insn:
(insn:HI 44 43 45 6 (set (reg:SI 0 ax [ type ])
(sign_extend:SI (subreg:QI (reg/v:SI 4 si [orig:63 type ] [63]) 0))) 84
{extendqisi2} (nil)
(nil))
gccbug.c:19: confused by earlier errors, bailing out
But it compile if I remove -fPIC or -O2
BTW, with gcc 3.4.1 cvs 0508 I get the following message in addition to the
error ( translated from french ):
Internal compiler error: in spill_failure at reload1.c:1897
This is a regression from gcc 3.4.3
There is maybe more updated information on the Mandriva bugreport:
http://qa.mandriva.com/show_bug.cgi?id=15840
--
Summary: error: unable to find a register to spill in class
'Q_REGS' with -fPIC and -O2
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: couriousous at mandriva dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21518