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 10:41:50 +0200
- Subject: Re: [PATCH GCC]Fix PR57540, try to choose scaled_offset address mode when expanding array reference
- References: <1398126 dot DXY1Hx70QN at polaris> <1641021 dot yEjj6JVXb8 at polaris>
> My mistake. It's because arm_legitimize_address cannot re-factor "[r105 +
> r165*4 + (-2064)]" into "rx = r105 + (-2064); [rx + r165*4]". Do you
> suggest that this kind of transformation should be done in backend? I can
> think of some disadvantages by doing it in backend:
> Different kinds of address expression might be wanted in different phase of
> compilation, for example, sometimes GCC wants to force computation of
> address expression out of memory access because it cannot CSE array
> indexing. It's difficult to differentiate in backend.
It's equally difficult in memory_address_addr_space and it affects all the
architectures at once... You said in the original message that Thumb2 and ARM
modes are already not equally sensitive to it, so it's not unthinkable that
some architectures might not want it at all. Therefore, yes, this should
preferably be handled in arm_legitimize_address.
--
Eric Botcazou