aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-11-24 20:35:38 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-11-24 19:35:38 +0000
commitaea50b45f5db36d77d4cf8488dd98d8a06c073a8 (patch)
tree2720a21d3a42af746351fb5f5e419414f55e6da8 /gcc/tree.h
parent73c923307beaf7c49d753528fead01615ff85847 (diff)
downloadgcc-aea50b45f5db36d77d4cf8488dd98d8a06c073a8.zip
gcc-aea50b45f5db36d77d4cf8488dd98d8a06c073a8.tar.gz
gcc-aea50b45f5db36d77d4cf8488dd98d8a06c073a8.tar.bz2
lto-streamer-in.c (lto_read_body_or_constructor): Set TYPE_CANONICAL only for types where LTO sets them.
* lto-streamer-in.c (lto_read_body_or_constructor): Set TYPE_CANONICAL only for types where LTO sets them. * tree.c (build_array_type_1): Do ont set TYPE_CANONICAL for LTO. (make_vector_type): Likewise. (gimple_canonical_types_compatible_p): Use canonical_type_used_p. * tree.h (canonical_type_used_p): New inline. * alias.c (get_alias_set): Handle structural equality for all types that pass canonical_type_used_p. (record_component_aliases): Look through all types with record_component_aliases for possible pointers; sanity check that the alias sets match. * lto.c (iterative_hash_canonical_type): Recruse for all types which pass !canonical_type_used_p. (gimple_register_canonical_type_1): Sanity check we do not compute canonical type of anything with !canonical_type_used_p. (gimple_register_canonical_type): Skip all types that are !canonical_type_used_p From-SVN: r230835
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 6c733aa..121c88b 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4811,7 +4811,9 @@ extern void DEBUG_FUNCTION verify_type (const_tree t);
extern bool gimple_canonical_types_compatible_p (const_tree, const_tree,
bool trust_type_canonical = true);
extern bool type_with_interoperable_signedness (const_tree);
-/* Return simplified tree code of type that is used for canonical type merging. */
+
+/* Return simplified tree code of type that is used for canonical type
+ merging. */
inline enum tree_code
tree_code_for_canonical_type_merging (enum tree_code code)
{
@@ -4833,6 +4835,23 @@ tree_code_for_canonical_type_merging (enum tree_code code)
return code;
}
+/* Return ture if get_alias_set care about TYPE_CANONICAL of given type.
+ We don't define the types for pointers, arrays and vectors. The reason is
+ that pointers are handled specially: ptr_type_node accesses conflict with
+ accesses to all other pointers. This is done by alias.c.
+ Because alias sets of arrays and vectors are the same as types of their
+ elements, we can't compute canonical type either. Otherwise we could go
+ form void *[10] to int *[10] (because they are equivalent for canonical type
+ machinery) and get wrong TBAA. */
+
+inline bool
+canonical_type_used_p (const_tree t)
+{
+ return !(POINTER_TYPE_P (t)
+ || TREE_CODE (t) == ARRAY_TYPE
+ || TREE_CODE (t) == VECTOR_TYPE);
+}
+
#define tree_map_eq tree_map_base_eq
extern unsigned int tree_map_hash (const void *);
#define tree_map_marked_p tree_map_base_marked_p