C++-20 module: internal compiler error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc |
Confirmed
|
Medium
|
|||
gcc-11 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I have a minimal sample project where I try to wrap the spdlog library inside a module unit like so:
```
// spdlog_wrapper.cpp
module;
#define SPDLOG_HEADER_ONLY
#include "spdlog/
#include "spdlog/
export module spdlog_wrapper;
export int hej() { return 42; }
```
And I compile it like so:
```
g++-11 -std=c++20 -fmodules-ts -I spdlog/include/ -c spdlog_wrapper.cpp
```
I get the following terminal output:
spdlog_
7 | export module spdlog_wrapper;
| ^~~~~~
0xe306b3 internal_error(char const*, ...)
???:0
0xe27039 fancy_abort(char const*, int, char const*)
???:0
0x9e4d4e trees_out:
???:0
0x9e5534 trees_out:
???:0
0x9e7f49 trees_out:
???:0
0x9e6a75 trees_out:
???:0
0x9e4fa6 trees_out:
???:0
0x9e5534 trees_out:
???:0
0x9e59f6 trees_out:
???:0
0x9e93f8 depset:
???:0
0x9ec92d module_
???:0
0xf9fe8e c_parse_
???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:/
make: *** [Makefile:4: spdlog_wrapper] Error 1
Some additional information:
$ g++-11 --version
> g++-11 (Ubuntu 11.1.0-
$ lsb_release -a
> No LSB modules are available.
> Distributor ID: Ubuntu
> Description: Ubuntu 20.04.2 LTS
> Release: 20.04
> Codename: focal
I have experienced the exact same error (or VERY similar in terms of terminal error message)
when trying to compile the xxhash.hpp library header into a BMI directly.
Even though that's a different error, perhaps there is some overlap?
Kind regards,
Alexander
Changed in gcc: | |
importance: | Unknown → Medium |
status: | Unknown → New |
Changed in gcc: | |
status: | New → Confirmed |
Created attachment 54077
reduced testcase
Maybe related to PR107083
Compiler output: pc-linux- gnu-g++ -fmodule-header testcase.C :core_vals( tree_node* )
/repo/ gcc-trunk/ gcc/cp/ module. cc:6262 :tree_node_ vals(tree_ node*)
/repo/ gcc-trunk/ gcc/cp/ module. cc:7216 :tree_value( tree_node* )
/repo/ gcc-trunk/ gcc/cp/ module. cc:9081 :tree_node( tree_node* )
/repo/ gcc-trunk/ gcc/cp/ module. cc:9279 :core_vals( tree_node* )
/repo/ gcc-trunk/ gcc/cp/ module. cc:6170 :tree_node_ vals(tree_ node*)
/repo/ gcc-trunk/ gcc/cp/ module. cc:7216 :decl_value( tree_node* , depset*)
/repo/ gcc-trunk/ gcc/cp/ module. cc:7795 :hash:: find_dependenci es(module_ state*)
/repo/ gcc-trunk/ gcc/cp/ module. cc:13326 state:: write_begin( elf_out* , cpp_reader*, module_ state_config& , unsigned int&)
/repo/ gcc-trunk/ gcc/cp/ module. cc:17893 module_ processing( cpp_reader* )
/repo/ gcc-trunk/ gcc/cp/ module. cc:20235 final_cleanups( )
/repo/ gcc-trunk/ gcc/cp/ decl2.cc: 5148 parse_file( )
/repo/ gcc-trunk/ gcc/c-family/ c-opts. cc:1266 /gcc.gnu. org/bugs/> for instructions.
$ x86_64-
testcase.C: internal compiler error: in core_vals, at cp/module.cc:6262
0x7083ca trees_out:
0xf3ea44 trees_out:
0xf3ea44 trees_out:
0xf3a8b1 trees_out:
0xf3bba0 trees_out:
0xf3939a trees_out:
0xf3939a trees_out:
0xf409e2 depset:
0xf41171 module_
0xf42574 finish_
0xed1912 c_parse_
0x10fd190 c_common_
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https:/
$ x86_64- pc-linux- gnu-g++ -v GCC=/repo/ gcc-trunk/ binary- latest/ bin/x86_ 64-pc-linux- gnu-g++ LTO_WRAPPER= /repo/gcc- trunk/binary- trunk-r13- 4610-2022121213 2425-g14d0f82ca b3-checking- yes-rtl- df-extra- amd64/bin/ ../libexec/ gcc/x86_ 64-pc-linux- gnu/13. 0.0/lto- wrapper trunk// configure --enable- languages= c,c++ --enable- valgrind- annotations --disable-nls --enable- checking= yes,rtl, df,extra --with-cloog --with-ppl --with-isl --build= x86_64- pc-linux- gnu --host= x86_64- pc-linux- gnu --target= x86_64- pc-linux- gnu --with- ld=/usr/ bin/x86_ 64-pc-linux- gnu-ld --with- as=/usr/ bin/x86_ 64-pc-linux- gnu-as --disable- libstdcxx- pch --prefix= /repo/gcc- trunk// binary- trunk-r13- 4610-2022121213 2425-g14d0f82ca b3-checking- yes-rtl- df-extra- amd64
Using built-in specs.
COLLECT_
COLLECT_
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.0.0 20221212 (experimental) (GCC)