From 652a8c1cde9cea866af3199c3e4a7fb1e7e909a3 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Sun, 11 Oct 2009 16:29:57 +0000 Subject: [PATCH] gimple.c (iterative_hash_type_name): Do not handle special anonymous names. 2009-10-11 Richard Guenther * gimple.c (iterative_hash_type_name): Do not handle special anonymous names. cp/ * tree.c (cp_free_lang_data): Drop anonymous aggregate names. From-SVN: r152643 --- gcc/ChangeLog | 5 +++++ gcc/cp/ChangeLog | 4 ++++ gcc/cp/tree.c | 11 +++++++++++ gcc/gimple.c | 15 --------------- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 668a75636ea..2ebe6cae03c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-10-11 Richard Guenther + + * gimple.c (iterative_hash_type_name): Do not handle special + anonymous names. + 2009-10-11 Uros Bizjak * config/i386/i386.md (*setcc_di_1): New insn_and_split pattern. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 063db183eb3..67a5deaa69e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2009-10-11 Richard Guenther + + * tree.c (cp_free_lang_data): Drop anonymous aggregate names. + 2009-10-08 Jason Merrill PR c++/36816 diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 156a09e25a6..76763735b97 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -3129,6 +3129,17 @@ cp_free_lang_data (tree t) DECL_EXTERNAL (t) = 1; TREE_STATIC (t) = 0; } + if (CP_AGGREGATE_TYPE_P (t) + && TYPE_NAME (t)) + { + tree name = TYPE_NAME (t); + if (TREE_CODE (name) == TYPE_DECL) + name = DECL_NAME (name); + /* Drop anonymous names. */ + if (name != NULL_TREE + && ANON_AGGRNAME_P (name)) + TYPE_NAME (t) = NULL_TREE; + } } diff --git a/gcc/gimple.c b/gcc/gimple.c index 88353196f9c..29eec519b7d 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -3591,21 +3591,6 @@ iterative_hash_type_name (tree type, hashval_t v) if (!name) return v; gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE); - /* Do not hash names of anonymous unions. At least the C++ FE insists - to have a non-NULL TYPE_NAME for them. See cp/cp-tree.h for all - the glory. */ -#ifndef NO_DOT_IN_LABEL - if (IDENTIFIER_POINTER (name)[0] == '.') - return v; -#else -#ifndef NO_DOLLAR_IN_LABEL - if (IDENTIFIER_POINTER (name)[0] == '$') - return v; -#else - if (!strncmp (IDENTIFIER_POINTER (name), "__anon_", sizeof ("__anon_") - 1)) - return v; -#endif -#endif return iterative_hash_object (IDENTIFIER_HASH_VALUE (name), v); }