[PATCH] Fix may_propagate_copy for pointers
Andrew Pinski
apinski@apple.com
Wed Sep 15 01:14:00 GMT 2004
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;
}
More information about the Gcc-patches
mailing list