[Bug 1945364] Re: C++-20 module: internal compiler error
Matthias Klose
1945364 at bugs.launchpad.net
Thu Jul 27 03:10:28 UTC 2023
** Bug watch added: GCC Bugzilla #108080
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108080
** Also affects: gcc via
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108080
Importance: Unknown
Status: Unknown
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-11 in Ubuntu.
https://bugs.launchpad.net/bugs/1945364
Title:
C++-20 module: internal compiler error
Status in gcc:
Unknown
Status in gcc-11 package in Ubuntu:
New
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/spdlog.h"
#include "spdlog/include/spdlog/sinks/stdout_color_sinks.h"
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_wrapper.cpp:7:8: internal compiler error: in core_vals, at cp/module.cc:6113
7 | export module spdlog_wrapper;
| ^~~~~~
0xe306b3 internal_error(char const*, ...)
???:0
0xe27039 fancy_abort(char const*, int, char const*)
???:0
0x9e4d4e trees_out::core_vals(tree_node*)
???:0
0x9e5534 trees_out::tree_node_vals(tree_node*)
???:0
0x9e7f49 trees_out::tree_value(tree_node*)
???:0
0x9e6a75 trees_out::tree_node(tree_node*)
???:0
0x9e4fa6 trees_out::core_vals(tree_node*)
???:0
0x9e5534 trees_out::tree_node_vals(tree_node*)
???:0
0x9e59f6 trees_out::decl_value(tree_node*, depset*)
???:0
0x9e93f8 depset::hash::find_dependencies(module_state*)
???:0
0x9ec92d module_state::write(elf_out*, cpp_reader*)
???:0
0xf9fe8e c_parse_final_cleanups()
???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.
make: *** [Makefile:4: spdlog_wrapper] Error 1
Some additional information:
$ g++-11 --version
> g++-11 (Ubuntu 11.1.0-1ubuntu1~20.04) 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
To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/1945364/+subscriptions
More information about the foundations-bugs
mailing list