This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix may_propagate_copy for pointers
On Sep 14, 2004, at 5:24 PM, Diego Novillo wrote:
On Tue, 2004-09-14 at 19:55, Andrew Pinski wrote:
* tree-ssa-copy.c (may_propagate_copy): Don't check the aliasing
sets of the pointers but the aliasing sets of what they point to.
OK after you add a test case that exposes the problem.
Testcase:
g++.dg/tree-ssa/pointer-reference-alias.C:
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-vars" } */
int f(int *a)
{
int &b = *a;
b = 0;
return *a;
}
/* There should be only one dereferencing of a. */
/* { dg-final { scan-tree-dump-times "\\*a" 1 "vars"} } */
Thanks,
Andrew Pinski