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

           Summary: ICE: SIGSEGV in should_emit_struct_debug
                    (dwarf2out.c:627) with -femit-struct-debug-baseonly -g
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: zso...@seznam.cz


Created attachment 22923
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22923
reduced testcase

Compiler output:
$ gcc -femit-struct-debug-baseonly -g pr47209.C
==21262== Invalid read of size 2
==21262==    at 0x78AC0E: should_emit_struct_debug (dwarf2out.c:627)
==21262==    by 0x7BAA0C: dwarf2out_imported_module_or_decl (dwarf2out.c:21164)
==21262==    by 0x678056: cp_emit_debug_info_for_using (name-lookup.c:5653)
==21262==    by 0x5A6D80: check_bases_and_members (class.c:1204)
==21262==    by 0x5A9DC1: finish_struct_1 (class.c:5531)
==21262==    by 0x5AB834: finish_struct (class.c:5760)
==21262==    by 0x5D0FC9: cp_parser_type_specifier (parser.c:16919)
==21262==    by 0x5D24E7: cp_parser_decl_specifier_seq (parser.c:9969)
==21262==    by 0x5E97BA: cp_parser_simple_declaration (parser.c:9626)
==21262==    by 0x5E9BE6: cp_parser_block_declaration (parser.c:9587)
==21262==    by 0x5ED8F1: cp_parser_declaration (parser.c:9492)
==21262==    by 0x5EC419: cp_parser_declaration_seq_opt (parser.c:9378)
==21262==    by 0x5EDF68: c_parse_file (parser.c:3461)
==21262==    by 0x6C2194: c_common_parse_file (c-opts.c:1071)
==21262==    by 0xA24597: toplev_main (toplev.c:579)
==21262==    by 0x6369BBC: (below main) (in /lib64/libc-2.11.2.so)
==21262==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==21262== 
pr47209.C:6:8: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested revisions:
r168552 - crash
4.5.2, 4.4.5, 4.3.5 - crash
4.2.4 - doesn't know -femit-struct-debug-baseonly

In the testcase, "  base::foo;" can be changes to "using base::foo;", it will
still fail.

Reply via email to