summaryrefslogtreecommitdiff
path: root/gcc/lto/lto.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-03 23:13:49 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-03 23:13:49 +0000
commit9c0b7e868a5956dbe481d21015e22d73aa227996 (patch)
treede7a5c9a9e666510f95a3f68ca8db557f286982f /gcc/lto/lto.c
parent6ad473596f6ce40d809f689071268930b8342a4d (diff)
downloadgcc-9c0b7e868a5956dbe481d21015e22d73aa227996.tar.gz
* lto.c (iterative_hash_canonical_type,
gimple_register_canonical_type): only hash main variants of types * tree.c (verify_type_variant): Verify that type and variant is compatible. (gimple_canonical_types_compatible_p): Look for main variants. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224107 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto/lto.c')
-rw-r--r--gcc/lto/lto.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 169b025eda5..75774a10600 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -413,6 +413,9 @@ static void
iterative_hash_canonical_type (tree type, inchash::hash &hstate)
{
hashval_t v;
+
+ /* All type variants have same TYPE_CANONICAL. */
+ type = TYPE_MAIN_VARIANT (type);
/* An already processed type. */
if (TYPE_CANONICAL (type))
{
@@ -498,7 +501,15 @@ gimple_register_canonical_type (tree t)
if (TYPE_CANONICAL (t) || !type_with_alias_set_p (t))
return;
- gimple_register_canonical_type_1 (t, hash_canonical_type (t));
+ /* Canonical types are same among all complete variants. */
+ if (TYPE_CANONICAL (TYPE_MAIN_VARIANT (t)))
+ TYPE_CANONICAL (t) = TYPE_CANONICAL (TYPE_MAIN_VARIANT (t));
+ else
+ {
+ gimple_register_canonical_type_1 (TYPE_MAIN_VARIANT (t),
+ hash_canonical_type (TYPE_MAIN_VARIANT (t)));
+ TYPE_CANONICAL (t) = TYPE_CANONICAL (TYPE_MAIN_VARIANT (t));
+ }
}
/* Re-compute TYPE_CANONICAL for NODE and related types. */