This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/53942] New: unable to find a register to spill in class 'CREG'
- From: "ncahill_alt at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 Jul 2012 16:23:52 +0000
- Subject: [Bug rtl-optimization/53942] New: unable to find a register to spill in class 'CREG'
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53942
Bug #: 53942
Summary: unable to find a register to spill in class 'CREG'
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: ncahill_alt@yahoo.com
This command:
gcc -O2 -mtune=pentium2 -fno-inline -x c++ -std=gnu++98 -c a.c -o a.o
gives this output:
### output ###
a.c: In function 'unsigned char _ZL1fP2S_h.isra.0(UINT16, UINT16, UINT16,
unsigned char)':
a.c:25:1: error: unable to find a register to spill in class 'CREG'
a.c:25:1: error: this is the insn:
(insn 11 7 12 2 (parallel [
(set (reg:SI 1 dx [85])
(ashiftrt:SI (reg:SI 1 dx [85])
(reg/v:QI 81 [ i ])))
(clobber (reg:CC 17 flags))
]) a.c:20 409 {*ashrsi3_1}
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)))
a.c:25: confused by earlier errors, bailing out
### end output ###
when compiling this testcase:
### a.c ###
typedef unsigned short UINT16;
typedef unsigned int UINT32;
typedef struct S_ S;
struct S_ {
UINT16 data[3];
UINT32 x;
UINT32 y;
};
static inline S *get_S() {}
static unsigned char f(S *s, unsigned char i)
{
unsigned char c=0;
unsigned char v;
v = s->data[0];
c|=v;
v=((s->data[1])&(1<<i))?1:0;
c|=v<<1;
v=((s->data[2])&0xff)&(1<<i);
c|=v<<2;
return c;
}
void g()
{
S *s = get_S();
s->x=f(s,6);
s->y=f(s,7);
}
### end a.c ###
Using -mtune=i686 works. I'm using gcc 4.7.1, i686-pc-linux-gnu, 32-bit.
Thank you.
Neil.