aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2013-09-24 11:04:04 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2013-09-24 11:04:04 +0000
commitf40333afeb570012ed42439cb9ce3c7aaa63b916 (patch)
tree648deb8197d0c5862100744de7dc74e36afb91ec /gcc/tree.c
parent583e8bf5d0b400730b2dec40a6989523fc420946 (diff)
downloadgcc-f40333afeb570012ed42439cb9ce3c7aaa63b916.zip
gcc-f40333afeb570012ed42439cb9ce3c7aaa63b916.tar.gz
gcc-f40333afeb570012ed42439cb9ce3c7aaa63b916.tar.bz2
re PR tree-optimization/58513 (*var and MEM[(const int &)var] (var has int* type) are not treated as the same data ref.)
2013-09-24 Richard Biener <rguenther@suse.de> PR middle-end/58513 * tree.c (reference_alias_ptr_type): Move ... * alias.c (reference_alias_ptr_type): ... here and implement in terms of the new reference_alias_ptr_type_1. (ref_all_alias_ptr_type_p): New helper. (get_deref_alias_set_1): Drop flag_strict_aliasing here, use ref_all_alias_ptr_type_p. (get_deref_alias_set): Add flag_strict_aliasing check here. (reference_alias_ptr_type_1): New function, split out from ... (get_alias_set): ... here. (alias_ptr_types_compatible_p): New function. * alias.h (reference_alias_ptr_type): Declare. (alias_ptr_types_compatible_p): Likewise. * tree.h (reference_alias_ptr_type): Remove. * fold-const.c (operand_equal_p): Use alias_ptr_types_compatible_p to compare MEM_REF alias types. * g++.dg/vect/pr58513.cc: New testcase. From-SVN: r202865
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 6593cf8..a7b66c5 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4263,24 +4263,6 @@ mem_ref_offset (const_tree t)
return tree_to_double_int (toff).sext (TYPE_PRECISION (TREE_TYPE (toff)));
}
-/* Return the pointer-type relevant for TBAA purposes from the
- gimple memory reference tree T. This is the type to be used for
- the offset operand of MEM_REF or TARGET_MEM_REF replacements of T. */
-
-tree
-reference_alias_ptr_type (const_tree t)
-{
- const_tree base = t;
- while (handled_component_p (base))
- base = TREE_OPERAND (base, 0);
- if (TREE_CODE (base) == MEM_REF)
- return TREE_TYPE (TREE_OPERAND (base, 1));
- else if (TREE_CODE (base) == TARGET_MEM_REF)
- return TREE_TYPE (TMR_OFFSET (base));
- else
- return build_pointer_type (TYPE_MAIN_VARIANT (TREE_TYPE (base)));
-}
-
/* Return an invariant ADDR_EXPR of type TYPE taking the address of BASE
offsetted by OFFSET units. */