https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110808
Bug ID: 110808 Summary: [modules] Internal Compiler Error in check_mergeable_decl Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mihi32 at gmail dot com Target Milestone: --- Created attachment 55632 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55632&action=edit Archive with the 3 cpp files that reproduce the error. // tres.cpp export module group:tres; int mul() { return 0; } // group.cpp export module group; export import :tres; // main.cpp import group:tres; int main() { return mul(); } -------------------------------------------------------------------- $ g++-12 -freport-bug -std=c++20 -fmodules-ts tres.cpp group.cpp main.cpp -o main main.cpp: In function ‘int main()’: main.cpp:5:16: internal compiler error: Segmentation fault 5 | return mul(); | ^~~ 0xd910e3 crash_signal ../../src/gcc/toplev.cc:322 0x7facc691751f ??? ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0x76fc34 ovl_iterator::operator*() const ../../src/gcc/cp/cp-tree.h:842 0x76fc34 check_mergeable_decl ../../src/gcc/cp/module.cc:10570 0x792150 trees_in::key_mergeable(int, merge_kind, tree_node*, tree_node*, tree_node*, tree_node*, bool) ../../src/gcc/cp/module.cc:10805 0x794f14 trees_in::decl_value() ../../src/gcc/cp/module.cc:7921 0x78fa77 trees_in::tree_node(bool) ../../src/gcc/cp/module.cc:9172 0x795b4b module_state::read_cluster(unsigned int) ../../src/gcc/cp/module.cc:14838 0x7960a5 module_state::load_section(unsigned int, binding_slot*) ../../src/gcc/cp/module.cc:18109 0x796237 lazy_load_binding(unsigned int, tree_node*, tree_node*, binding_slot*) ../../src/gcc/cp/module.cc:18801 0x7a3ec4 name_lookup::search_namespace_only(tree_node*) ../../src/gcc/cp/name-lookup.cc:919 0x7a523b name_lookup::search_unqualified(tree_node*, cp_binding_level*) ../../src/gcc/cp/name-lookup.cc:1142 0x7a6fab lookup_name(tree_node*, LOOK_where, LOOK_want) ../../src/gcc/cp/name-lookup.cc:7774 0x7aee01 lookup_name(tree_node*, LOOK_want) ../../src/gcc/cp/name-lookup.h:404 0x7aee01 cp_parser_lookup_name ../../src/gcc/cp/parser.cc:30605 0x7dd045 cp_parser_class_name ../../src/gcc/cp/parser.cc:25693 0x7dd31c cp_parser_type_name ../../src/gcc/cp/parser.cc:20140 0x7ebee0 cp_parser_simple_type_specifier ../../src/gcc/cp/parser.cc:19831 0x7d27fa cp_parser_postfix_expression ../../src/gcc/cp/parser.cc:7573 0x7bc7c6 cp_parser_binary_expression ../../src/gcc/cp/parser.cc:10035 Please submit a full bug report, with preprocessed source. Please include the complete backtrace with any bug report. See <file:///usr/share/doc/gcc-12/README.Bugs> for instructions. The bug is not reproducible, so it is likely a hardware or OS problem. ----------------------------------------------------- $ g++-12 -v Using built-in specs. COLLECT_GCC=g++-12 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 12.1.0-2ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-12-sZcx2y/gcc-12-12.1.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-12-sZcx2y/gcc-12-12.1.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.1.0 (Ubuntu 12.1.0-2ubuntu1~22.04)