aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
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.c
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.c')
-rw-r--r--gcc/tree.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 2888657..4176d61 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -8252,7 +8252,8 @@ build_array_type_1 (tree elt_type, tree index_type, bool shared)
if (TYPE_CANONICAL (t) == t)
{
if (TYPE_STRUCTURAL_EQUALITY_P (elt_type)
- || (index_type && TYPE_STRUCTURAL_EQUALITY_P (index_type)))
+ || (index_type && TYPE_STRUCTURAL_EQUALITY_P (index_type))
+ || in_lto_p)
SET_TYPE_STRUCTURAL_EQUALITY (t);
else if (TYPE_CANONICAL (elt_type) != elt_type
|| (index_type && TYPE_CANONICAL (index_type) != index_type))
@@ -9865,7 +9866,7 @@ make_vector_type (tree innertype, int nunits, machine_mode mode)
SET_TYPE_VECTOR_SUBPARTS (t, nunits);
SET_TYPE_MODE (t, mode);
- if (TYPE_STRUCTURAL_EQUALITY_P (innertype))
+ if (TYPE_STRUCTURAL_EQUALITY_P (innertype) || in_lto_p)
SET_TYPE_STRUCTURAL_EQUALITY (t);
else if ((TYPE_CANONICAL (innertype) != innertype
|| mode != VOIDmode)
@@ -13295,7 +13296,8 @@ gimple_canonical_types_compatible_p (const_tree t1, const_tree t2,
TYPE_CANONICAL is more fine grained than the equivalnce we test (where
all pointers are considered equal. Be sure to not return false
negatives. */
- gcc_checking_assert (!POINTER_TYPE_P (t1) && !POINTER_TYPE_P (t2));
+ gcc_checking_assert (canonical_type_used_p (t1)
+ && canonical_type_used_p (t2));
return TYPE_CANONICAL (t1) == TYPE_CANONICAL (t2);
}