re PR debug/6387 (-fpic -gdwarf-2 -g1 combination give ICE in dwarf2out)
authorJason Merrill <jason@redhat.com>
Sat, 15 Mar 2003 17:06:24 +0000 (12:06 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 15 Mar 2003 17:06:24 +0000 (12:06 -0500)
        PR debug/6387
        * dwarf2out.c (dwarf2out_decl): If we're at -g1, just stick nested
        function DIEs at toplevel.
        (decls_for_scope): At -g1, don't descend into subblocks.

From-SVN: r64410

gcc/ChangeLog
gcc/dwarf2out.c

index b2ffd69800f3a810d48a514f9ae931b66cf4e5c5..2a73783cee6d9ea4199241c8fc315fd347e15012 100644 (file)
@@ -1,3 +1,10 @@
+2003-03-15  Jason Merrill  <jason@redhat.com>
+
+       PR debug/6387
+       * dwarf2out.c (dwarf2out_decl): If we're at -g1, just stick nested
+       function DIEs at toplevel.
+       (decls_for_scope): At -g1, don't descend into subblocks.
+
 2003-03-15  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * varasm.c (struct rtx_const): Change type of un.addr member
index 6a15a3b13f849104f78ce70a1fb8681f5524a3f2..e31fcb878d38865a2368dcc5102dc342e4251454 100644 (file)
@@ -12018,6 +12018,10 @@ decls_for_scope (stmt, context_die, depth)
        gen_decl_die (decl, context_die);
     }
 
+  /* If we're at -g1, we're not interested in subblocks.  */
+  if (debug_info_level <= DINFO_LEVEL_TERSE)
+    return;
+
   /* Output the DIEs to represent all sub-blocks (and the items declared
      therein) of this block.  */
   for (subblocks = BLOCK_SUBBLOCKS (stmt);
@@ -12286,7 +12290,9 @@ dwarf2out_decl (decl)
       /* If we're a nested function, initially use a parent of NULL; if we're
         a plain function, this will be fixed up in decls_for_scope.  If
         we're a method, it will be ignored, since we already have a DIE.  */
-      if (decl_function_context (decl))
+      if (decl_function_context (decl)
+         /* But if we're in terse mode, we don't care about scope.  */
+         && debug_info_level > DINFO_LEVEL_TERSE)
        context_die = NULL;
       break;