diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b7704877055..1a7bb1eb2e7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-11-17 Richard Guenther + + PR lto/46504 + * gimple.c (gimple_register_canonical_type): Make sure to only + make type leaders canonical types. + 2010-11-17 Michael Matz * timevar.def (TV_IPA_OPT, TV_EARLY_LOCAL, TV_OPTIMIZE, diff --git a/gcc/gimple.c b/gcc/gimple.c index 6704456c0cc..5f6b8d41c48 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. */