I have a similar issue with GCC 13.2.1. The weird part about it is that it seems to depend on the exact value of some compiler flags rather than the actual source file content. I'm trying to use g++ to compile {fmt} as a module and this is what I get:
When building with CMake the {fmt} itself (go to repository, `mkdir build; cd build; cmake .. -DFMT_MODULE=ON && make`, the command
```
/usr/bin/c++ -I/home/greg/.cpm/fmt/c85658eda638008e7e9290fcd31836ed9f7be1a4/include -O3 -DNDEBUG -std=gnu++20 -fvisibility=hidden -fvisibility-inlines-hidden -fmodules-ts -MD -MT CMakeFiles/fmt.dir/src/fmt.cc.o -MF CMakeFiles/fmt.dir/src/fmt.cc.o.d -o CMakeFiles/fmt.dir/src/fmt.cc.o -c /home/greg/.cpm/fmt/c85658eda638008e7e9290fcd31836ed9f7be1a4/src/fmt.cc
```
executes successfully and the compilation is OK.
However, when compiling {fmt} as a CMake subproject, the command is a little different:
```
cd /home/greg/projects/cpp/4seudo/build/_deps/fmt-build && /usr/bin/c++ -I/home/greg/.cpm/fmt/c85658eda638008e7e9290fcd31836ed9f7be1a4/include -std=c++20 -fmodules-ts -MD -MT _deps/fmt-build/CMakeFiles/fmt.dir/src/fmt.cc.o -MF CMakeFiles/fmt.dir/src/fmt.cc.o.d -o CMakeFiles/fmt.dir/src/fmt.cc.o -c /home/greg/.cpm/fmt/c85658eda638008e7e9290fcd31836ed9f7be1a4/src/fmt.cc
```
And _this_ command fails with an ICE:
```
$ cd /home/greg/projects/cpp/4seudo/build/_deps/fmt-build && /usr/bin/c++ -I/home/greg/.cpm/fmt/c85658eda638008e7e9290fcd31836ed9f7be1a4/include -std=c++20 -fmodules-ts -MD -MT _deps/fmt-build/CMakeFiles/fmt.dir/src/fmt.cc.o -MF CMakeFiles/fmt.dir/src/fmt.cc.o.d -o CMakeFiles/fmt.dir/src/fmt.cc.o -c /home/greg/.cpm/fmt/c85658eda638008e7e9290fcd31836ed9f7be1a4/src/fmt.cc -freport-bug
/home/greg/.cpm/fmt/c85658eda638008e7e9290fcd31836ed9f7be1a4/src/fmt.cc:73:8: internal compiler error: in core_vals, at cp/module.cc:6262
73 | export module fmt;
| ^~~~~~
0x1ad33c8 internal_error(char const*, ...)
???:0
0x6b7b63 fancy_abort(char const*, int, char const*)
???:0
0x7c98b7 trees_out::tree_value(tree_node*)
???:0
0x7c763d trees_out::tree_node(tree_node*)
???:0
0x7c8806 trees_out::core_vals(tree_node*)
???:0
0x7c8d64 trees_out::tree_node_vals(tree_node*)
???:0
0x7c616b trees_out::decl_value(tree_node*, depset*)
???:0
0x7cb47f depset::hash::find_dependencies(module_state*)
???:0
0x7cc422 module_state::write_begin(elf_out*, cpp_reader*, module_state_config&, unsigned int&)
???:0
0x7dc105 finish_module_processing(cpp_reader*)
???:0
0x7714fd c_parse_final_cleanups()
???:0
0x9444b4 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://bugs.archlinux.org/> for instructions.
Preprocessed source stored into /tmp/ccoSmHEM.out file, please attach this to your bugreport.
```
Maybe there is an error in arguments parsing?
I will be attaching ccoSmHEM.out to this issue now.
I have a similar issue with GCC 13.2.1. The weird part about it is that it seems to depend on the exact value of some compiler flags rather than the actual source file content. I'm trying to use g++ to compile {fmt} as a module and this is what I get:
When building with CMake the {fmt} itself (go to repository, `mkdir build; cd build; cmake .. -DFMT_MODULE=ON && make`, the command greg/.cpm/ fmt/c85658eda63 8008e7e9290fcd3 1836ed9f7be1a4/ include -O3 -DNDEBUG -std=gnu++20 -fvisibility=hidden -fvisibility- inlines- hidden -fmodules-ts -MD -MT CMakeFiles/ fmt.dir/ src/fmt. cc.o -MF CMakeFiles/ fmt.dir/ src/fmt. cc.o.d -o CMakeFiles/ fmt.dir/ src/fmt. cc.o -c /home/greg/ .cpm/fmt/ c85658eda638008 e7e9290fcd31836 ed9f7be1a4/ src/fmt. cc
```
/usr/bin/c++ -I/home/
```
executes successfully and the compilation is OK.
However, when compiling {fmt} as a CMake subproject, the command is a little different: projects/ cpp/4seudo/ build/_ deps/fmt- build && /usr/bin/c++ -I/home/ greg/.cpm/ fmt/c85658eda63 8008e7e9290fcd3 1836ed9f7be1a4/ include -std=c++20 -fmodules-ts -MD -MT _deps/fmt- build/CMakeFile s/fmt.dir/ src/fmt. cc.o -MF CMakeFiles/ fmt.dir/ src/fmt. cc.o.d -o CMakeFiles/ fmt.dir/ src/fmt. cc.o -c /home/greg/ .cpm/fmt/ c85658eda638008 e7e9290fcd31836 ed9f7be1a4/ src/fmt. cc
```
cd /home/greg/
```
And _this_ command fails with an ICE: projects/ cpp/4seudo/ build/_ deps/fmt- build && /usr/bin/c++ -I/home/ greg/.cpm/ fmt/c85658eda63 8008e7e9290fcd3 1836ed9f7be1a4/ include -std=c++20 -fmodules-ts -MD -MT _deps/fmt- build/CMakeFile s/fmt.dir/ src/fmt. cc.o -MF CMakeFiles/ fmt.dir/ src/fmt. cc.o.d -o CMakeFiles/ fmt.dir/ src/fmt. cc.o -c /home/greg/ .cpm/fmt/ c85658eda638008 e7e9290fcd31836 ed9f7be1a4/ src/fmt. cc -freport-bug
```
$ cd /home/greg/
/home/greg/ .cpm/fmt/ c85658eda638008 e7e9290fcd31836 ed9f7be1a4/ src/fmt. cc:73:8: internal compiler error: in core_vals, at cp/module.cc:6262 :tree_value( tree_node* ) :tree_node( tree_node* ) :core_vals( tree_node* ) :tree_node_ vals(tree_ node*) :decl_value( tree_node* , depset*) :hash:: find_dependenci es(module_ state*) state:: write_begin( elf_out* , cpp_reader*, module_ state_config& , unsigned int&) module_ processing( cpp_reader* ) final_cleanups( ) parse_file( ) /bugs.archlinux .org/> for instructions.
73 | export module fmt;
| ^~~~~~
0x1ad33c8 internal_error(char const*, ...)
???:0
0x6b7b63 fancy_abort(char const*, int, char const*)
???:0
0x7c98b7 trees_out:
???:0
0x7c763d trees_out:
???:0
0x7c8806 trees_out:
???:0
0x7c8d64 trees_out:
???:0
0x7c616b trees_out:
???:0
0x7cb47f depset:
???:0
0x7cc422 module_
???:0
0x7dc105 finish_
???:0
0x7714fd c_parse_
???:0
0x9444b4 c_common_
???:0
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https:/
Preprocessed source stored into /tmp/ccoSmHEM.out file, please attach this to your bugreport.
```
Maybe there is an error in arguments parsing?
I will be attaching ccoSmHEM.out to this issue now.