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: Michael Meissner <meissner@linux.vnet.ibm.com>
> 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.


- Jamie


      


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