This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add some REG_POINTER flags during ix86 memcpy/memset expansion (PR target/65504)
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 23 Mar 2015 16:26:36 +0100
- Subject: Re: [PATCH] Add some REG_POINTER flags during ix86 memcpy/memset expansion (PR target/65504)
- Authentication-results: sourceware.org; auth=none
- References: <20150323150738 dot GX1746 at tucnak dot redhat dot com>
On Mon, Mar 23, 2015 at 4:07 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> As expand_set_or_movmem_prologue_epilogue_by_misaligned_moves uses
> src = src - (adjusted_dest - dest)
> without proper REG_POINTER flags the aliasing code is very easily confused
> on what is really a pointer and what is not - as REG_POINTER was used
> after forwprop only on dest, but not on anything else, aliasing code thinks
> that the memcpy reads dest based memory, when it really reads src based
> memory (in the testcase frame pointer based in the end, but CSE did not see
> it through).
>
> Fixed by marking pseudos that must hold pointers with REG_POINTER during
> the expansion. Bootstrapped/regtested on x86_64-linux and i686-linux, ok
> for trunk?
>
> 2015-03-23 Jakub Jelinek <jakub@redhat.com>
>
> PR target/65504
> * config/i386/i386.c (ix86_copy_addr_to_reg): Set REG_POINTER
> on the pseudo.
> (expand_set_or_movmem_prologue_epilogue_by_misaligned_moves): Set
> REG_POINTER on *destptr after adjusting it for prologue size.
>
> * gfortran.dg/pr65504.f90: New test.
OK.
Thanks,
Uros.