summaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-in.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/lto-streamer-in.c
parent73c923307beaf7c49d753528fead01615ff85847 (diff)
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/lto-streamer-in.c')
-rw-r--r--gcc/lto-streamer-in.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index 4c4a39be627..53298519b05 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -1231,7 +1231,9 @@ lto_read_body_or_constructor (struct lto_file_decl_data *file_data, struct symta
if (TYPE_P (t))
{
gcc_assert (TYPE_CANONICAL (t) == NULL_TREE);
- TYPE_CANONICAL (t) = TYPE_MAIN_VARIANT (t);
+ if (type_with_alias_set_p (t)
+ && canonical_type_used_p (t))
+ TYPE_CANONICAL (t) = TYPE_MAIN_VARIANT (t);
if (TYPE_MAIN_VARIANT (t) != t)
{
gcc_assert (TYPE_NEXT_VARIANT (t) == NULL_TREE);