This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PING [ARM, RFC] Fix strange code in arm_legitimize_address
- From: Ramana Radhakrishnan <ramana dot gcc at googlemail dot com>
- To: Jie Zhang <jie at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Date: Thu, 20 Jan 2011 18:58:11 +0000
- Subject: Re: PING [ARM, RFC] Fix strange code in arm_legitimize_address
- References: <4D1DE803.8060805@codesourcery.com> <4D33A57B.5040908@codesourcery.com>
On Mon, Jan 17, 2011 at 2:12 AM, Jie Zhang <jie@codesourcery.com> wrote:
> PING.
>
> On 12/31/2010 10:26 PM, Jie Zhang wrote:
>>
>> Hi,
>>
>> I found this while looking at something else. The following code in
>> arm_legitimize_address is confusing for me:
>>
>> if (GET_CODE (x) == PLUS)
>> {
>> rtx xop0 = XEXP (x, 0);
>> rtx xop1 = XEXP (x, 1);
>>
>> if (CONSTANT_P (xop0) && !symbol_mentioned_p (xop0))
>> xop0 = force_reg (SImode, xop0);
>>
>> if (CONSTANT_P (xop1) && !symbol_mentioned_p (xop1))
>> xop1 = force_reg (SImode, xop1); <== code A
>>
>> if (ARM_BASE_REGISTER_RTX_P (xop0)
>> && GET_CODE (xop1) == CONST_INT)
>> {
>> ... <== code B
>> }
>> ...
>> }
>>
>> The code B will never be executed since xop1 will never be a CONST_INT.
>> If it were, it would have already been put into a reg by code A.
Yeah I went through this and couldn't make out why this is the way it
is. Looks good to me though I can't approve or reject your patch.
cheers
Ramana
>
>> OK?
>>
>> Regards,
>
>
> --
> Jie Zhang
>
>