This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix may_propagate_copy for pointers
- From: Andrew Pinski <apinski at apple dot com>
- To: "gcc-patches at gcc dot gnu dot org Patches" <gcc-patches at gcc dot gnu dot org>
- Cc: Diego Novillo <dnovillo at redhat dot com>
- Date: Tue, 14 Sep 2004 16:55:08 -0700
- Subject: [PATCH] Fix may_propagate_copy for pointers
For may_propagate_copy and pointers, it is not the pointers' aliasing
sets which need to check to make sure that they do not conflict but
the aliasing sets of the type which they point to.
This patch fixes the problem and also should help out some C++ code
where we don't propagate a reference variable into a pointer variable.
OK? Bootstrapped on powerpc-apple-darwin with no regressions.
Thanks,
Andrew Pinski
ChangeLog:
* 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.
Index: tree-ssa-copy.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-copy.c,v
retrieving revision 2.14
diff -u -p -r2.14 tree-ssa-copy.c
--- tree-ssa-copy.c 9 Sep 2004 07:54:11 -0000 2.14
+++ tree-ssa-copy.c 14 Sep 2004 23:50:20 -0000
@@ -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;
}