aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimple.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b770487..1a7bb1e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-17 Richard Guenther <rguenther@suse.de>
+
+ PR lto/46504
+ * gimple.c (gimple_register_canonical_type): Make sure to only
+ make type leaders canonical types.
+
2010-11-17 Michael Matz <matz@suse.de>
* timevar.def (TV_IPA_OPT, TV_EARLY_LOCAL, TV_OPTIMIZE,
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 6704456..5f6b8d4 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -4398,6 +4398,10 @@ gimple_register_canonical_type (tree t)
if (TYPE_CANONICAL (t))
return TYPE_CANONICAL (t);
+ /* Always register the type itself first so that if it turns out
+ to be the canonical type it will be the one we merge to as well. */
+ t = gimple_register_type (t);
+
/* Always register the main variant first. This is important so we
pick up the non-typedef variants as canonical, otherwise we'll end
up taking typedef ids for structure tags during comparison. */