diff mbox

RFA: patch to fix PR58785 (an ARM LRA crash)

Message ID CAD57uCca5rNCN7SGCAwsiK-w=m44=mHbUejqortWgDDAUyk_CA@mail.gmail.com
State New
Headers show

Commit Message

Yvan Roux Nov. 20, 2013, 9:22 a.m. UTC
Hi,

as Richard said, only a subset of rclass is allowed to be returned by
preferred_reload_class.  I've tested the attached patched in Thumb
mode, on ARMv5, A9 and A9hf and on cross A15 without regression.

Yvan

2013-11-20  Yvan Roux  <yvan.roux@linaro.org>

        PR target/58785
        * config/arm/arm.c (arm_preferred_reload_class): Only return LO_REGS
        when rclass is GENERAL_REGS.

Comments

Yvan Roux Nov. 27, 2013, 10:19 a.m. UTC | #1
Ping.

On 20 November 2013 10:22, Yvan Roux <yvan.roux@linaro.org> wrote:
> Hi,
>
> as Richard said, only a subset of rclass is allowed to be returned by
> preferred_reload_class.  I've tested the attached patched in Thumb
> mode, on ARMv5, A9 and A9hf and on cross A15 without regression.
>
> Yvan
>
> 2013-11-20  Yvan Roux  <yvan.roux@linaro.org>
>
>         PR target/58785
>         * config/arm/arm.c (arm_preferred_reload_class): Only return LO_REGS
>         when rclass is GENERAL_REGS.
Richard Earnshaw Nov. 27, 2013, 4:08 p.m. UTC | #2
On 20/11/13 09:22, Yvan Roux wrote:
> Hi,
> 
> as Richard said, only a subset of rclass is allowed to be returned by
> preferred_reload_class.  I've tested the attached patched in Thumb
> mode, on ARMv5, A9 and A9hf and on cross A15 without regression.
> 
> Yvan
> 
> 2013-11-20  Yvan Roux  <yvan.roux@linaro.org>
> 
>         PR target/58785
>         * config/arm/arm.c (arm_preferred_reload_class): Only return LO_REGS
>         when rclass is GENERAL_REGS.
> 
> 
> preferred_reload.diff
> 
> 
> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> index 5c53440..63f10bd 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -6882,10 +6882,7 @@ arm_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, reg_class_t rclass)
>      return rclass;
>    else
>      {
> -      if (rclass == GENERAL_REGS
> -	  || rclass == HI_REGS
> -	  || rclass == NO_REGS
> -	  || rclass == STACK_REG)
> +      if (rclass == GENERAL_REGS)
>  	return LO_REGS;
>        else
>  	return rclass;
> 

OK.

R.
Jeff Law Nov. 27, 2013, 6:35 p.m. UTC | #3
On 11/27/13 03:19, Yvan Roux wrote:
> Ping.
>
> On 20 November 2013 10:22, Yvan Roux <yvan.roux@linaro.org> wrote:
>> Hi,
>>
>> as Richard said, only a subset of rclass is allowed to be returned by
>> preferred_reload_class.
I don't think he was quite that definitive.  "One reading of the manual 
suggests ...".  However, Richard's interpretation is the same as I've 
had for eons.  You can return the original class, a narrower class or 
NO_REGS.





   I've tested the attached patched in Thumb
>> mode, on ARMv5, A9 and A9hf and on cross A15 without regression.
>>
>> Yvan
>>
>> 2013-11-20  Yvan Roux  <yvan.roux@linaro.org>
>>
>>          PR target/58785
>>          * config/arm/arm.c (arm_preferred_reload_class): Only return LO_REGS
>>          when rclass is GENERAL_REGS.
This is fine for the trunk as it implements Richard's recommendation and 
brings the code into compliance with the semantics of P_R_C.

Jeff
Yvan Roux Nov. 27, 2013, 8:26 p.m. UTC | #4
> I don't think he was quite that definitive.  "One reading of the manual
> suggests ...".  However, Richard's interpretation is the same as I've had
> for eons.  You can return the original class, a narrower class or NO_REGS.

Yes, I also read the manual and discussed the patch with Richard
offline, but was a bit lazy in the description ;)

>   I've tested the attached patched in Thumb
>>>
>>> mode, on ARMv5, A9 and A9hf and on cross A15 without regression.
>>>
>>> Yvan
>>>
>>> 2013-11-20  Yvan Roux  <yvan.roux@linaro.org>
>>>
>>>          PR target/58785
>>>          * config/arm/arm.c (arm_preferred_reload_class): Only return
>>> LO_REGS
>>>          when rclass is GENERAL_REGS.
>
> This is fine for the trunk as it implements Richard's recommendation and
> brings the code into compliance with the semantics of P_R_C.

I'll also add the testcase I put in bugzilla and that was in Vlad's
first patch, if it's ok for you.

Yvan
Richard Earnshaw Nov. 28, 2013, 10:18 a.m. UTC | #5
On 27/11/13 18:35, Jeff Law wrote:
> On 11/27/13 03:19, Yvan Roux wrote:
>> Ping.
>>
>> On 20 November 2013 10:22, Yvan Roux <yvan.roux@linaro.org> wrote:
>>> Hi,
>>>
>>> as Richard said, only a subset of rclass is allowed to be returned by
>>> preferred_reload_class.
> I don't think he was quite that definitive.  "One reading of the manual 
> suggests ...".  However, Richard's interpretation is the same as I've 
> had for eons.  You can return the original class, a narrower class or 
> NO_REGS.

Perhaps the manual could be clarified to make this more explicit.

R.
diff mbox

Patch

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 5c53440..63f10bd 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -6882,10 +6882,7 @@  arm_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, reg_class_t rclass)
     return rclass;
   else
     {
-      if (rclass == GENERAL_REGS
-	  || rclass == HI_REGS
-	  || rclass == NO_REGS
-	  || rclass == STACK_REG)
+      if (rclass == GENERAL_REGS)
 	return LO_REGS;
       else
 	return rclass;