pointer-reference-alias.C: New test.

2004-09-14  Andrew Pinski  <apinski@apple.com>

        * g++.dg/tree-ssa/pointer-reference-alias.C: New test.

2004-09-14  Andrew Pinski  <apinski@apple.com>

        * 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.

From-SVN: r87527
This commit is contained in:
Andrew Pinski 2004-09-15 01:18:01 +00:00 committed by Andrew Pinski
parent 798e5365d4
commit 5ffcd77909
4 changed files with 24 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2004-09-14 Andrew Pinski <apinski@apple.com>
* 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.
2004-09-14 Roger Sayle <roger@eyesopen.com>
PR rtl-optimization/9771

View File

@ -1,3 +1,7 @@
2004-09-14 Andrew Pinski <apinski@apple.com>
* g++.dg/tree-ssa/pointer-reference-alias.C: New test.
2004-09-14 Roger Sayle <roger@eyesopen.com>
PR rtl-optimization/9771

View File

@ -0,0 +1,13 @@
/* { 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"} } */

View File

@ -112,8 +112,8 @@ may_propagate_copy (tree dest, tree orig)
return false;
else if (!lang_hooks.types_compatible_p (type_d, type_o))
return false;
else if (!alias_sets_conflict_p (get_alias_set (type_d),
get_alias_set (type_o)))
else if (!alias_sets_conflict_p (get_alias_set (TREE_TYPE (type_d)),
get_alias_set (TREE_TYPE (type_o))))
return false;
}