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

            Bug ID: 129282
           Summary: [modules] internal compiler error: in write_location,
                    at cp/module.cc:18843 with -freflection
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

$ cat reflect-4_a.H
// { dg-do compile { target c++26 } }
// { dg-additional-options "-fmodule-header -freflection" }
// { dg-module-cmi {} }

template<typename T> using same = T;

$ cat reflect-4_b.C
// { dg-do compile { target c++26 } }
// { dg-additional-options "-fmodules -freflection" }
// { dg-module-cmi a }

module;
#include "reflect-4_a.H"
export module a;

export same<int> fa ();

$ xg++ -std=c++26 -fmodule-header -freflection reflect-4_a.H -c
$ xg++ -std=c++26 -fmodules -freflection reflect-4_b.C
reflect-4_b.C:8:8: internal compiler error: in write_location, at
cp/module.cc:18843
    8 | export module a;
      |        ^~~~~~
0x3268e92 internal_error(char const*, ...)
        /home/mpolacek/src/gcc/gcc/diagnostic-global-context.cc:787
0x327791d fancy_abort(char const*, int, char const*)
        /home/mpolacek/src/gcc/gcc/diagnostics/context.cc:1813
0x6b52d3 write_location
        /home/mpolacek/src/gcc/gcc/cp/module.cc:18843
0x67a155 core_vals
        /home/mpolacek/src/gcc/gcc/cp/module.cc:6427
0x6804a8 tree_node_vals
        /home/mpolacek/src/gcc/gcc/cp/module.cc:7893
0x682c15 decl_value
        /home/mpolacek/src/gcc/gcc/cp/module.cc:8539
0x686bff decl_node
        /home/mpolacek/src/gcc/gcc/cp/module.cc:9258
0x68ca16 tree_node
        /home/mpolacek/src/gcc/gcc/cp/module.cc:10393
0x6b08b8 module_state::write_cluster(elf_out*, depset**, unsigned int,
depset::hash&, unsigned int*, unsigned int*)
        /home/mpolacek/src/gcc/gcc/cp/module.cc:17546
0x6bc841 module_state::write_begin(elf_out*, cpp_reader*, module_state_config&,
unsigned int&)
        /home/mpolacek/src/gcc/gcc/cp/module.cc:21255
0x6c5831 finish_module_processing(cpp_reader*)
        /home/mpolacek/src/gcc/gcc/cp/module.cc:24018
0x5cbb08 c_parse_final_cleanups()
        /home/mpolacek/src/gcc/gcc/cp/decl2.cc:6126
0xa35d53 c_common_parse_file()
        /home/mpolacek/src/gcc/gcc/c-family/c-opts.cc:1477
/home/mpolacek/x/trunk/gcc/cc1plus -quiet -nostdinc++ -I
/home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I /home/mpolacek/x/trunk/x86_64-pc-linux-gnu/libstdc++-v3/include -I
/home/mpolacek/src/gcc/libstdc++-v3/libsupc++ -I
/home/mpolacek/src/gcc/libstdc++-v3/include/backward -I
/home/mpolacek/src/gcc/libstdc++-v3/testsuite/util -iprefix
/home/mpolacek/x/trunk/gcc/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/ -isystem
/home/mpolacek/x/trunk/gcc/include -isystem
/home/mpolacek/x/trunk/gcc/include-fixed -D_GNU_SOURCE reflect-4_b.C -quiet
-dumpdir a- -dumpbase reflect-4_b.C -dumpbase-ext .C -mtune=generic
-march=x86-64 -std=c++26 -fmodules -freflection -o /tmp/ccsoPHjA.s

Reply via email to