This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug debug/47209] ICE: SIGSEGV in should_emit_struct_debug (dwarf2out.c:627) with -f{no-,}emit-struct-debug-{baseonly,reduced} -g


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47209

Kai Tietz <ktietz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktietz at gcc dot gnu.org

--- Comment #4 from Kai Tietz <ktietz at gcc dot gnu.org> 2011-01-08 20:55:20 UTC ---
Well, the issue here seems to be that in should_emit_struct_debug
TYPE_STUB_DECL (type) for provided type is a NULL_TREE. In next two
if-statements this result is used unconditionally. I am not sure if the
underlying issue is related to some other place in c++ FE (I assume so), but
following patch at least avoid segfault.

Index: dwarf2out.c
===================================================================
--- dwarf2out.c (revision 168601)
+++ dwarf2out.c (working copy)
@@ -620,12 +620,14 @@
     return DUMP_GSTRUCT (type, usage, criterion, generic, false, true);

   type_decl = TYPE_STUB_DECL (type);
+  if (type_decl != NULL_TREE)
+    {
+      if (criterion == DINFO_STRUCT_FILE_SYS && DECL_IN_SYSTEM_HEADER
(type_decl))
+       return DUMP_GSTRUCT (type, usage, criterion, generic, false, true);

-  if (criterion == DINFO_STRUCT_FILE_SYS && DECL_IN_SYSTEM_HEADER (type_decl))
-    return DUMP_GSTRUCT (type, usage, criterion, generic, false, true);
-
-  if (matches_main_base (DECL_SOURCE_FILE (type_decl)))
-    return DUMP_GSTRUCT (type, usage, criterion, generic, true, true);
+      if (matches_main_base (DECL_SOURCE_FILE (type_decl)))
+       return DUMP_GSTRUCT (type, usage, criterion, generic, true, true);
+    }
   return DUMP_GSTRUCT (type, usage, criterion, generic, false, false);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]