This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Do not allow non-allocatable registers in scratch_operand
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 19 Sep 2014 07:21:16 -0500
- Subject: Re: [PATCH] Do not allow non-allocatable registers in scratch_operand
- Authentication-results: sourceware.org; auth=none
- References: <74729933448c3ec81b326073757add5ddb1165a7 dot 1410826448 dot git dot segher at kernel dot crashing dot org> <541BC526 dot 8040406 at redhat dot com>
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