This disentangles canonical type merging from type merging. LTO bootstrapped and tested on x86_64-unknown-linux-gnu, SPEC 2k6 LTO tested, committed.
Richard. 2011-05-31 Richard Guenther <rguent...@suse.de> * gimple.c (gimple_register_canonical_type): Do not register any types via gimple_register_type. Index: gcc/gimple.c =================================================================== --- gcc/gimple.c (revision 174478) +++ gcc/gimple.c (working copy) @@ -4749,21 +4749,12 @@ tree gimple_register_canonical_type (tree t) { void **slot; - tree orig_t = t; gcc_assert (TYPE_P (t)); if (TYPE_CANONICAL (t)) return TYPE_CANONICAL (t); - /* Use the leader of our main variant for determining our canonical - type. The main variant leader is a type that will always - prevail. */ - t = gimple_register_type (TYPE_MAIN_VARIANT (t)); - - if (TYPE_CANONICAL (t)) - return TYPE_CANONICAL (t); - if (gimple_canonical_types == NULL) gimple_canonical_types = htab_create_ggc (16381, gimple_canonical_type_hash, gimple_canonical_type_eq, 0); @@ -4783,9 +4774,6 @@ gimple_register_canonical_type (tree t) *slot = (void *) t; } - /* Also cache the canonical type in the non-leaders. */ - TYPE_CANONICAL (orig_t) = t; - return t; }