https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79000

            Bug ID: 79000
           Summary: ICE: in gen_member_die, at dwarf2out.c:23995
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Keywords: lto
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org
  Target Milestone: ---

A Gentoo users emailed me the following mixed C/C++ LTO testcase:

markus@x4 /tmp % cat 1.ii
struct a {
  a();
} b;

markus@x4 /tmp % cat 2.i
typedef struct a b;
typedef struct a {
} b;
struct {
  b c;
} d;

markus@x4 /tmp % gcc -g -flto -r -nostdlib 1.ii 2.i
lto1: internal compiler error: in gen_member_die, at dwarf2out.c:23995
0x6fa800 gen_member_die
        /home/markus/gcc/gcc/dwarf2out.c:23995
0x6fa800 gen_struct_or_union_type_die
        /home/markus/gcc/gcc/dwarf2out.c:24096
0x6fa800 gen_tagged_type_die
        /home/markus/gcc/gcc/dwarf2out.c:24306
0x712040 gen_typedef_die
        /home/markus/gcc/gcc/dwarf2out.c:24213
0x6f787a gen_decl_die
        /home/markus/gcc/gcc/dwarf2out.c:25155
0x6f84ae dwarf2out_decl
        /home/markus/gcc/gcc/dwarf2out.c:25636
0x6f887c dwarf2out_type_decl
        /home/markus/gcc/gcc/dwarf2out.c:25344
0x5eaf33 lto_read_decls
        /home/markus/gcc/gcc/lto/lto.c:1756
0x5ed8e3 lto_file_finalize
        /home/markus/gcc/gcc/lto/lto.c:2038
0x5ed8e3 lto_create_files_from_ids
        /home/markus/gcc/gcc/lto/lto.c:2048
0x5ed8e3 lto_file_read
        /home/markus/gcc/gcc/lto/lto.c:2089
0x5ed8e3 read_cgraph_and_symbols
        /home/markus/gcc/gcc/lto/lto.c:2799
0x5ed8e3 lto_main()
        /home/markus/gcc/gcc/lto/lto.c:3304

Breakpoint 1, gen_member_die (context_die=<optimized out>, type=0x0) at
/home/markus/gcc/gcc/dwarf2out.c:23995
23995     gcc_assert (TYPE_MAIN_VARIANT (type) == type);
(gdb) p type
$1 = (tree) 0x0

All supported gcc versions are affected.

Reply via email to