aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2004-11-04 20:11:13 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2004-11-04 20:11:13 +0000
commit106f5de5a5069c016b6e2c1929ffe217bf9a3c84 (patch)
tree0db24bfe2b9a4c70fca52c98ad9f0fd1dd54004d /gcc/tree-ssa.c
parentac8b3d9d72d430fb12d78f51938eb57cfa860754 (diff)
downloadgcc-106f5de5a5069c016b6e2c1929ffe217bf9a3c84.zip
gcc-106f5de5a5069c016b6e2c1929ffe217bf9a3c84.tar.gz
gcc-106f5de5a5069c016b6e2c1929ffe217bf9a3c84.tar.bz2
re PR tree-optimization/18184 (Tree optimizers ignore pointer modes)
ChangeLog: PR tree-optimization/18184 * c-typeck.c (comptypes): Do not treat pointers of different modes or alias-all flags as equivalent. * tree-ssa.c (tree_ssa_useless_type_conversion_1): Likewise. cp/ChangeLog: PR tree-optimization/18184 * cp-objcp-common.c (cxx_types_compatible_p): Do not treat pointers of different modes or alias-all flags as equivalent. * typeck.c (comptypes): Likewise. From-SVN: r90078
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 8002565..0e15eee 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -834,6 +834,9 @@ tree_ssa_useless_type_conversion_1 (tree outer_type, tree inner_type)
implement the ABI. */
else if (POINTER_TYPE_P (inner_type)
&& POINTER_TYPE_P (outer_type)
+ && TYPE_MODE (inner_type) == TYPE_MODE (outer_type)
+ && TYPE_REF_CAN_ALIAS_ALL (inner_type)
+ == TYPE_REF_CAN_ALIAS_ALL (outer_type)
&& TREE_CODE (TREE_TYPE (outer_type)) == VOID_TYPE)
return true;
@@ -841,6 +844,9 @@ tree_ssa_useless_type_conversion_1 (tree outer_type, tree inner_type)
so strip conversions that just switch between them. */
else if (POINTER_TYPE_P (inner_type)
&& POINTER_TYPE_P (outer_type)
+ && TYPE_MODE (inner_type) == TYPE_MODE (outer_type)
+ && TYPE_REF_CAN_ALIAS_ALL (inner_type)
+ == TYPE_REF_CAN_ALIAS_ALL (outer_type)
&& lang_hooks.types_compatible_p (TREE_TYPE (inner_type),
TREE_TYPE (outer_type)))
return true;