From: Richard Guenther Date: Tue, 17 May 2011 10:04:23 +0000 (+0000) Subject: gimple.c (gimple_register_canonical_type): Use the main-variant leader for computing... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6b6a59f36c4490f7bf53bb942793102292f1378e;p=gcc.git gimple.c (gimple_register_canonical_type): Use the main-variant leader for computing the canonical type. 2011-05-17 Richard Guenther * gimple.c (gimple_register_canonical_type): Use the main-variant leader for computing the canonical type. From-SVN: r173826 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 18243164f05..178f563754e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-05-17 Richard Guenther + + * gimple.c (gimple_register_canonical_type): Use the main-variant + leader for computing the canonical type. + 2011-05-17 Nick Clifton * config/rx/rx.c (rx_memory_move_cost): Include cost of register diff --git a/gcc/gimple.c b/gcc/gimple.c index 488e9713ddc..1daa13316fc 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -4856,19 +4856,14 @@ 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); + /* 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); - /* 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. */ - if (TYPE_MAIN_VARIANT (t) != t) - gimple_register_canonical_type (TYPE_MAIN_VARIANT (t)); - if (gimple_canonical_types == NULL) gimple_canonical_types = htab_create_ggc (16381, gimple_canonical_type_hash, gimple_canonical_type_eq, 0);