[PATCH] Use subreg_regno instead of subreg_regno_offset

Bernd Schmidt bschmidt@redhat.com
Thu Nov 5 10:33:00 GMT 2015


On 11/02/2015 11:29 PM, Anatoly Sokolov wrote:
>
>>> @@ -5522,12 +5516,7 @@
>>>           op0 = SUBREG_REG (op0);
>>>           code0 = GET_CODE (op0);
>>>           if (code0 == REG && REGNO (op0) < FIRST_PSEUDO_REGISTER)
>>> -          op0 = gen_rtx_REG (word_mode,
>>> -                 (REGNO (op0) +
>>> -                  subreg_regno_offset (REGNO (SUBREG_REG (orig_op0)),
>>> -                               GET_MODE (SUBREG_REG (orig_op0)),
>>> -                               SUBREG_BYTE (orig_op0),
>>> -                               GET_MODE (orig_op0))));
>>> +          op0 = gen_rtx_REG (word_mode, subreg_regno (op0));
>>>         }
>>
>> Same problem as in the reg-stack code? The existing code was using
>> orig_op0 to get the subreg, you've changed it to use op0 which is
>> already the SUBREG_REG.
>>
>
> No promblens here. At this point op0 is equivalent orig_op0. New value
> to op0 can be assigned later.

Err, what? Before the quoted code we have
         rtx op0 = orig_op0;
and then
            op0 = SUBREG_REG (op0);
Are you overlooking this line?

> +  else if (REG_P (reg) +       && HARD_REGISTER_P (reg))

I don't see how this would even compile.

> -      regno += subreg_regno_offset (regno, GET_MODE (SUBREG_REG (reg)),
> -                    SUBREG_BYTE (reg), GET_MODE (reg));
> +      regno = subreg_regno (reg);       endregno = regno + subreg_nregs (reg);

This looks like you edited the patch? The endregno assignment is on its 
own line after this.

NAK, a final one as far as I'm concerned.


Bernd



More information about the Gcc-patches mailing list