On Mon, Mar 23, 2015 at 4:07 PM, Jakub Jelinek <ja...@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 <ja...@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.