This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add some REG_POINTER flags during ix86 memcpy/memset expansion (PR target/65504)


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]