gimple.c (gimple_register_canonical_type): Use the main-variant leader for computing the canonical type.

2011-05-17  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_register_canonical_type): Use the main-variant
	leader for computing the canonical type.

From-SVN: r173826
This commit is contained in:
Richard Guenther 2011-05-17 10:04:23 +00:00 committed by Richard Biener
parent a1d8754e7d
commit 6b6a59f36c
2 changed files with 9 additions and 9 deletions

View File

@ -1,3 +1,8 @@
2011-05-17 Richard Guenther <rguenther@suse.de>
* gimple.c (gimple_register_canonical_type): Use the main-variant
leader for computing the canonical type.
2011-05-17 Nick Clifton <nickc@redhat.com>
* config/rx/rx.c (rx_memory_move_cost): Include cost of register

View File

@ -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);