This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use alias-oracle for memmove -> memcpy folding
- From: Richard Guenther <rguenther at suse dot de>
- To: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 1 Sep 2009 10:29:46 +0200 (CEST)
- Subject: Re: [PATCH] Use alias-oracle for memmove -> memcpy folding
- References: <alpine.LNX.2.00.0908311434460.28140@zhemvz.fhfr.qr> <Pine.GSO.4.58.0908312213060.22663@caipclassic.rutgers.edu>
On Mon, 31 Aug 2009, Kaveh R. GHAZI wrote:
> On Mon, 31 Aug 2009, Richard Guenther wrote:
>
> >
> > This changes the folding code that transforms memmove to memcpy to
> > use the alias oracle to query whether the memory arguments may overlap.
> > The patch also relaxes what we accept for pointers in INDIRECT_REFs
> > in the oracle to allow easy use of it even from the early folders
> > where we are not in gimple form.
> >
> > Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
> >
> > Richard.
> >
> > 2009-08-31 Richard Guenther <rguenther@suse.de>
> >
> > * builtins.c (fold_builtin_memory_op): Use the alias oracle
> > to query if the memory regions for memmove overlap.
> > * tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Relax the
> > asserts on pointers, instead deal with odd trees.
> > (ptr_derefs_may_alias_p): Likewise.
> > (refs_may_alias_p_1): Constructor bases also never alias.
>
> Would this be PR 21602 ?
Sort of. The testcase there isn't fixed because dst escapes
and we make sure stores to it are kept live by marking it as
global memory. Which the incoming argument also points to.
This is a case that PTA currently doesn't handle optimally.
Richard.