re PR debug/86452 (ICE in force_decl_die, at dwarf2out.c:25922 with -g1 and -flto)
authorRichard Biener <rguenther@suse.de>
Fri, 13 Jul 2018 06:42:31 +0000 (06:42 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 13 Jul 2018 06:42:31 +0000 (06:42 +0000)
2018-07-13  Richard Biener  <rguenther@suse.de>

PR debug/86452
* dwarf2out.c (gen_type_die_with_usage): Use scope_die_for
instead of get_context_die.

From-SVN: r262624

gcc/ChangeLog
gcc/dwarf2out.c

index 0cfa2309c61d1835093ce9fe8bff51f4a218208e..07ff2b02e02dd82801efaf594601aba17720b5cd 100644 (file)
@@ -1,3 +1,9 @@
+2018-07-13  Richard Biener  <rguenther@suse.de>
+
+       PR debug/86452
+       * dwarf2out.c (gen_type_die_with_usage): Use scope_die_for
+       instead of get_context_die.
+
 2018-07-13  Kugan Vivekanandarajah  <kuganv@linaro.org>
            Richard Biener  <rguenther@suse.de>
 
index c2422e29658b6a101034318deed224271e6f1ca7..ba5c63eaf0bbce369b93a40d15f632221b114afa 100644 (file)
@@ -25388,11 +25388,8 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die,
      generate debug info for the typedef.  */
   if (is_naming_typedef_decl (TYPE_NAME (type)))
     {
-      /* Use the DIE of the containing namespace as the parent DIE of
-         the type description DIE we want to generate.  */
-      if (DECL_CONTEXT (TYPE_NAME (type))
-         && TREE_CODE (DECL_CONTEXT (TYPE_NAME (type))) == NAMESPACE_DECL)
-       context_die = get_context_die (DECL_CONTEXT (TYPE_NAME (type)));
+      /* Give typedefs the right scope.  */
+      context_die = scope_die_for (type, context_die);
 
       gen_decl_die (TYPE_NAME (type), NULL, NULL, context_die);
       return;