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

            Bug ID: 98417
           Summary: -internal compiler error when using -g
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick.kox at commandoregel dot be
  Target Milestone: ---

I'm new so I hope this is the correct way to report this.

When using the -g flag with the C++20 modules example from the wiki
(https://gcc.gnu.org/wiki/cxx-modules) the compiler gives an internal compiler
error.

This is with version (g++ (GCC) 11.0.0 20201220 (experimental)).
The output of the compiler is:

g++ -g -Wall -fmodules-ts   -c -MMD -MP -o hello.o hello.cc
g++ -g -Wall -fmodules-ts   -c -MMD -MP -o main.o main.cc
main.cc: In function ‘int main()’:
main.cc:11:3: internal compiler error: in gen_typedef_die, at dwarf2out.c:25373
   11 |   greeter ("world");
      |   ^~~~~~~
0x7471d6 gen_typedef_die
        ../.././gcc/dwarf2out.c:25373
0x7471d6 gen_typedef_die
        ../.././gcc/dwarf2out.c:25345
0xcef8fa gen_decl_die
        ../.././gcc/dwarf2out.c:26377
0xcf1b13 gen_member_die
        ../.././gcc/dwarf2out.c:25188
0xcf1b13 gen_struct_or_union_type_die
        ../.././gcc/dwarf2out.c:25284
0xcf1b13 gen_tagged_type_die
        ../.././gcc/dwarf2out.c:25485
0xd0c8d9 gen_tagged_type_die
        ../.././gcc/dwarf2out.c:25439
0xd0c8d9 gen_typedef_die
        ../.././gcc/dwarf2out.c:25399
0xd0c8d9 gen_typedef_die
        ../.././gcc/dwarf2out.c:25345
0xcef8fa gen_decl_die
        ../.././gcc/dwarf2out.c:26377
0xcf4426 gen_type_die
        ../.././gcc/dwarf2out.c:25735
0xcef3c2 gen_decl_die
        ../.././gcc/dwarf2out.c:26374
0xcf05b3 dwarf2out_decl
        ../.././gcc/dwarf2out.c:26929
0xcf0b41 dwarf2out_type_decl
        ../.././gcc/dwarf2out.c:26647
0xcf0b41 dwarf2out_type_decl
        ../.././gcc/dwarf2out.c:26642
0xfd75f4 rest_of_type_compilation(tree_node*, int)
        ../.././gcc/passes.c:339
0xa1ec9d trees_in::read_class_def(tree_node*, tree_node*)
        ../.././gcc/cp/module.cc:12161
0xa204d9 module_state::read_cluster(unsigned int)
        ../.././gcc/cp/module.cc:14901
0xa20cfd module_state::load_section(unsigned int, binding_slot*)
        ../.././gcc/cp/module.cc:18032
0xa20dbf module_state::lazy_load(unsigned int, binding_slot*)
        ../.././gcc/cp/module.cc:18681
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make: *** [<builtin>: main.o] Error 1

removing the -g flag from the command solves the issue

Reply via email to