OSDN Git Service

2009-10-11 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 11 Oct 2009 16:29:57 +0000 (16:29 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 11 Oct 2009 16:29:57 +0000 (16:29 +0000)
* gimple.c (iterative_hash_type_name): Do not handle special
anonymous names.

cp/
* tree.c (cp_free_lang_data): Drop anonymous aggregate names.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152643 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/tree.c
gcc/gimple.c

index 668a756..2ebe6ca 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-11  Richard Guenther  <rguenther@suse.de>
+
+       * gimple.c (iterative_hash_type_name): Do not handle special
+       anonymous names.
+
 2009-10-11  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.md (*setcc_di_1): New insn_and_split pattern.
index 063db18..67a5dea 100644 (file)
@@ -1,3 +1,7 @@
+2009-10-11  Richard Guenther  <rguenther@suse.de>
+
+       * tree.c (cp_free_lang_data): Drop anonymous aggregate names.
+
 2009-10-08  Jason Merrill  <jason@redhat.com>
 
        PR c++/36816
index 156a09e..7676373 100644 (file)
@@ -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;
+    }
 }
 
 \f
index 8835319..29eec51 100644 (file)
@@ -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);
 }