This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH GCC]Fix PR57540, try to choose scaled_offset address mode when expanding array reference
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Bin Cheng <bin dot cheng at arm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 17 Jun 2013 09:31:31 +0200
- Subject: Re: [PATCH GCC]Fix PR57540, try to choose scaled_offset address mode when expanding array reference
- References: <1398126 dot DXY1Hx70QN at polaris>
> The problem occurs when accessing local array element. For example,
> # VUSE <.MEM_27>
> k_8 = parent[k_29];
>
> GCC calculates the address in three steps:
> 1) addr is calculated as "r105 + (-2064)".
> 2) offset is calculated as "r165*4".
> 3) calls offset_address to combine the address into "r105+ r165*4 +
> (-2064)".
>
> Since ADDR is valid and there is no call to memory_address_addr_space in
> offset_address, the invalid address expression has no chance to go through
> target dependent legitimization function.
But offset_address calls change_address_1 with validate set to 1 so during RTL
expansion memory_address_addr_space should be invoked on the invalid address.
> Even there is a chance, the
> current implementation of memory_address_addr_space prevents the scaled
> address expression from being generated because of below code:
> if (! cse_not_expected && !REG_P (x))
> x = break_out_memory_refs (x);
Where are the memory references in the above address?
--
Eric Botcazou