This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Extending constraints using register subclasses


----- Original Message ----
> From: Jamie Prescott <jpresss@yahoo.com>
> To: Jamie Prescott <jpresss@yahoo.com>; Michael Meissner <meissner@linux.vnet.ibm.com>
> Cc: gcc@gcc.gnu.org
> Sent: Thursday, May 14, 2009 5:36:14 PM
> Subject: Re: Extending constraints using register subclasses
> 
> ----- Original Message ----
> > From: Jamie Prescott 
> > To: Michael Meissner 
> > Cc: gcc@gcc.gnu.org
> > Sent: Thursday, May 14, 2009 4:22:13 PM
> > Subject: Re: Extending constraints using register subclasses
> > OK, I tried reordering the classes by putting smaller ones first. Did not 
> work.
> > As far as IRA_COVER_CLASS, this should be a new thing, isn't it? I'm currently
> > on 4.3.3 and I found no mention of it anywhere.
> 
> OK, the problem is in reg_fits_class_p().
> 
> void dseek(unsigned int offset)
> {
>         asm volatile ("dsk r56\n\t":: "a2" (offset));
> }
> 
> The r56 register is part of GENERAL_REGS (0..64) and 'a2' is 'r2', that is a 
> subclass (R2_REG)
> of GENERAL_REGS containing only one register.
> In recog.c, in the 'default' switch handling, there's a call to the 
> REG_CLASS_FROM_CONSTRAINT()
> that I hooked, to return R2_REG upon 'a2'.
> That code ends up calling reg_fits_class_p() with 'operand' being the r0 REG 
> RTX, and 'cl' being R2_REG.
> Such function tests if r0 is inside R2_REG, that obviously isn't, and fails.

Found the culprit. I mistakenly had r0..r7 inside FIXED (on top of CALL_USED)  :|
Once I removed them from FIXED, everything seems to be working nicely and passed
a pretty exhaustive test suite.


- Jamie


      


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]