This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/47209] ICE: SIGSEGV in should_emit_struct_debug (dwarf2out.c:627) with -f{no-,}emit-struct-debug-{baseonly,reduced} -g
- From: "ktietz at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 8 Jan 2011 20:55:21 +0000
- Subject: [Bug debug/47209] ICE: SIGSEGV in should_emit_struct_debug (dwarf2out.c:627) with -f{no-,}emit-struct-debug-{baseonly,reduced} -g
- Auto-submitted: auto-generated
- References: <bug-47209-4@http.gcc.gnu.org/bugzilla/>
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);
}