aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2012-10-12 12:14:03 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-10-12 12:14:03 +0000
commitaec06f6fa8948de6eb8e23028b5ebf4e5fd3e36a (patch)
treecf9b66a87e39b21415229b72d1cec0c02098e5f8 /gcc/lto
parent87218838b83c5af78da5baad882b9d42a7b55445 (diff)
downloadgcc-aec06f6fa8948de6eb8e23028b5ebf4e5fd3e36a.zip
gcc-aec06f6fa8948de6eb8e23028b5ebf4e5fd3e36a.tar.gz
gcc-aec06f6fa8948de6eb8e23028b5ebf4e5fd3e36a.tar.bz2
re PR lto/54898 (ICE in uniquify_nodes, at lto/lto.c:1898)
2012-10-12 Richard Biener <rguenther@suse.de> PR lto/54898 * lto.c (gimple_types_compatible_p_1): Also compare TYPE_MAIN_VARIANT. (iterative_hash_gimple_type): Also hash TYPE_MAIN_VARIANT. From-SVN: r192397
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog7
-rw-r--r--gcc/lto/lto.c15
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 265922f..49b8af0 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,10 @@
+2012-10-12 Richard Biener <rguenther@suse.de>
+
+ PR lto/54898
+ * lto.c (gimple_types_compatible_p_1): Also compare
+ TYPE_MAIN_VARIANT.
+ (iterative_hash_gimple_type): Also hash TYPE_MAIN_VARIANT.
+
2012-10-09 Tobias Burnus <burnus@net-b.de>
* lto-lang.c (lto_register_builtin_type): Avoid useless
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 2b9156a..7f64dae 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -581,6 +581,15 @@ gimple_types_compatible_p_1 (tree t1, tree t2, type_pair_t p,
if (!compare_type_names_p (t1, t2))
goto different_types;
+ /* The main variant of both types should compare equal. */
+ if (TYPE_MAIN_VARIANT (t1) != t1
+ || TYPE_MAIN_VARIANT (t2) != t2)
+ {
+ if (!gtc_visit (TYPE_MAIN_VARIANT (t1), TYPE_MAIN_VARIANT (t2),
+ state, sccstack, sccstate, sccstate_obstack))
+ goto different_types;
+ }
+
/* We may not merge typedef types to the same type in different
contexts. */
if (TYPE_NAME (t1)
@@ -1101,6 +1110,12 @@ iterative_hash_gimple_type (tree type, hashval_t val,
&& TYPE_P (DECL_CONTEXT (TYPE_NAME (type))))
v = visit (DECL_CONTEXT (TYPE_NAME (type)), state, v,
sccstack, sccstate, sccstate_obstack);
+
+ /* Factor in the variant structure. */
+ if (TYPE_MAIN_VARIANT (type) != type)
+ v = visit (TYPE_MAIN_VARIANT (type), state, v,
+ sccstack, sccstate, sccstate_obstack);
+
v = iterative_hash_hashval_t (TREE_CODE (type), v);
v = iterative_hash_hashval_t (TYPE_QUALS (type), v);
v = iterative_hash_hashval_t (TREE_ADDRESSABLE (type), v);