SMALL_REGISTER_CLASSES

Geoffrey KEATING geoffk@discus.anu.edu.au
Sun Jan 25 21:44:00 GMT 1998


> Date: Mon, 26 Jan 1998 00:24:49 -0500
> From: David Edelsohn <dje@watson.ibm.com>

> >>>>> Geoffrey KEATING writes:
> 
> > Unfortunately, the user can mention regs explicitly in 'asm'
> > statements, too.  This causes problems on rs6000, where there are
> > no small register classes mentioned in the RTL, but users can write
> > things like
> 
> > asm ("" : : : "cr0");
> 
> > and get 'forbidden register spilled' if a pseudo (in this case, most
> > likely derived from a "CC" in the RTL) needs a register of that class.
> 
> 	This example can be handled by "x" and "y" register classes,
> right?  Or is this only a problem with asm clobbered registers?

Only with asm.

You can't really deal with this using 'x' [for the audience, 'x' is
the register class that includes only register cr0].  You might want
to write

asm ("whatever" : "x"(clobbered));

but then you have to declare 'clobbered' as a variable, and you can't
because there isn't a C type which can have MODE_CC :-(.

You can see egcs crash by trying

int foo(int x) { asm ("" : : : "cr0"); return x & 123; }

because the RTL for '& 123' needs to find a register in class 'x' (to
clobber it again :-) ).

--
Geoff Keating <Geoff.Keating@anu.edu.au>



More information about the Gcc mailing list