This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Do not directly change TARGET_MEM_REF in maybe_canonicalize_mem_ref_addr
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 16 Jun 2017 09:51:23 +0200
- Subject: Re: [patch] Do not directly change TARGET_MEM_REF in maybe_canonicalize_mem_ref_addr
- Authentication-results: sourceware.org; auth=none
- References: <59903573.zuAO1vMF2R@polaris>
On Thu, Jun 15, 2017 at 3:51 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Hi,
>
> the transformation done to TARGET_MEM_REF in maybe_canonicalize_mem_ref_addr
> is exactly the same as one of those done in maybe_fold_tmr, the latter is
> better written and the former function calls the latter, so this patch changes
> maybe_canonicalize_mem_ref_addr to avoid touching TARGET_MEM_REF directly.
>
> Tested on x86-64/Linux, OK for the mainline?
I don't think so. get_address_description assumes TMR_BASE is in
canonical form,
that is, when it is an ADDR_EXPR we have a symbol and when not we have
a pointer.
TMR[&p->a] violates this and the gimple-fold.c part first canonicalizes this to
TMR[p + offsetof(a)].
Richard.
>
> 2017-06-15 Eric Botcazou <ebotcazou@adacore.com>
>
> PR bootstrap/80897
> * gimple-fold.c (maybe_canonicalize_mem_ref_addr): Do not change
> TARGET_MEM_REF expressions directly.
>
> --
> Eric Botcazou