aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-05-17 10:04:23 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-05-17 10:04:23 +0000
commit6b6a59f36c4490f7bf53bb942793102292f1378e (patch)
tree6e2f1175af031ff9a1fb584751a9bf3694d4f49c
parenta1d8754e7dffbaa6a987dbfdb71cd6ad0ffbe9b7 (diff)
downloadgcc-6b6a59f36c4490f7bf53bb942793102292f1378e.zip
gcc-6b6a59f36c4490f7bf53bb942793102292f1378e.tar.gz
gcc-6b6a59f36c4490f7bf53bb942793102292f1378e.tar.bz2
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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/gimple.c13
2 files changed, 9 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1824316..178f563 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 488e971..1daa133 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);