This is the mail archive of the gcc-patches@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: [PATCH] Do not allow non-allocatable registers in scratch_operand


On Thu, Sep 18, 2014 at 11:54:46PM -0600, Jeff Law wrote:
> Shouldn't you be testing if the register is fixed rather than its class? 
>  Or maybe both?

register_operand (via general_operand) uses operand_reg_set for this; it is
initialised via the regclass NO_REGS too (and other things).

This would work for us (rs6000) too, or indeed fixed_regs[], or even wider
classes.  I have no idea if it would hurt other targets though, and I have
no desire to test all weirdo targets ;-)

If another regclass reg is assigned to a match_scratch (and then via a
splitter to a match_operand register), reload can fix it up.  It cannot
fix up things properly for regs of NO_REGS class.  This is what this patch
is for: a class NO_REGS reg cannot ever work as a match_scratch.

I could test for a wider class if you want, but I'll need some guidance
what to test for exactly then; existing code isn't exactly consistent.


Segher


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