This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] More thorough checking in reg_fits_class_p
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Richard Earnshaw <rearnsha at arm dot com>
- Cc: Jim MacArthur <jim dot macarthur at arm dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 02 May 2012 14:55:56 +0100
- Subject: Re: [patch] More thorough checking in reg_fits_class_p
- References: <4F994B99.1010606@arm.com> <4F9E9772.8080700@arm.com> <g4ehr5gvnq.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> <4F9E9DCB.7010206@arm.com> <g462chgu7f.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> <4F9EA849.8020807@arm.com> <g4y5pdfdsj.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> <4FA122AE.5040207@arm.com> <g4havyg2l1.fsf@richards-thinkpad.stglab.manchester.uk.ibm.com> <4FA13C03.70304@arm.com>
Richard Earnshaw <rearnsha@arm.com> writes:
> On 02/05/12 14:00, Richard Sandiford wrote:
>> Jim MacArthur <jim.macarthur@arm.com> writes:
>>> New Changelog text:
>>>
>>> 2012-05-02 Jim MacArthur<jim.macarthur@arm.com>
>>> * recog.c (reg_fits_class_p): Check both regno and regno + offset are
>>> hard registers.
>>
>> Thanks. I still think the final:
>>
>>> + && HARD_REGISTER_NUM_P (end_hard_regno (regno + offset, mode))
>>
>> check belongs in in_hard_reg_set_p, since most callers don't (and IMO
>> shouldn't need to) check this. The idea behind adding these functions
>> was to commonise various bits of code that were doing the same checks
>> in slightly different ways. Requiring each caller to check the end
>> register would go against that to some extent.
>>
>
> If you're going to do that (which is fine, BTW), I think
> in_hard_reg_set_p should gcc_assert() that regno is a valid hard reg.
Sounds good.
Richard