OSDN Git Service

2011-12-20 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Dec 2011 09:49:17 +0000 (09:49 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Dec 2011 09:49:17 +0000 (09:49 +0000)
PR lto/46796
* dwarf2out.c (modified_type_die): When the type variant
chain is corrupt use the types name, if available, instead
of __unknown__.

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

gcc/ChangeLog
gcc/dwarf2out.c

index 32c1d24..2dd1cc0 100644 (file)
@@ -1,3 +1,10 @@
+2011-12-20  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/46796
+       * dwarf2out.c (modified_type_die): When the type variant
+       chain is corrupt use the types name, if available, instead
+       of __unknown__.
+
 2011-12-20  Tristan Gingold  <gingold@adacore.com>
 
        * config/alpha/alpha.c (alpha_start_function): Adjust condition to
 2011-12-20  Tristan Gingold  <gingold@adacore.com>
 
        * config/alpha/alpha.c (alpha_start_function): Adjust condition to
index d5f469c..8de3613 100644 (file)
@@ -9873,7 +9873,14 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
     }
   /* This probably indicates a bug.  */
   else if (mod_type_die && mod_type_die->die_tag == DW_TAG_base_type)
     }
   /* This probably indicates a bug.  */
   else if (mod_type_die && mod_type_die->die_tag == DW_TAG_base_type)
-    add_name_attribute (mod_type_die, "__unknown__");
+    {
+      name = TYPE_NAME (type);
+      if (name
+         && TREE_CODE (name) == TYPE_DECL)
+       name = DECL_NAME (name);
+      add_name_attribute (mod_type_die,
+                         name ? IDENTIFIER_POINTER (name) : "__unknown__");
+    }
 
   if (qualified_type)
     equate_type_number_to_die (qualified_type, mod_type_die);
 
   if (qualified_type)
     equate_type_number_to_die (qualified_type, mod_type_die);