https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127787
Bug ID: 127787
Summary: [17 Regression] ICE in module.cc after
r17-4959-g13920d004da35b
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: iains at gcc dot gnu.org
Blocks: 99000
Target Milestone: ---
This shows up with g++.dg/modules/compile-std1.C on x86 darwin (because of an
SSE enabled specialisation), however it's not a darwin-specific issue:
hdr.h:
namespace N {
template<class T> struct A { template<class U> void f(); };
template<> template<class U> void A<int>::f() { }
}
mod.cc:
module;
#include "hdr.h"
export module M;
export using N::A;
use.C:
import M;
#include "hdr.h"
======
g++ -std=c++29 -fmodules -c mod.cc
g++ -std=c++29 -fmodules -fno-module-include-translate -c use.C
In file included from ../use.C:2:
../hdr.h:3:49: internal compiler error: in set_defining_module, at
cp/module.cc:22284
3 | template<> template<class U> void A<int>::f() { }
| ^
0x2e289df internal_error(char const*, ...)
../../src/gcc/diagnostic-global-context.cc:787
0xb7b979 fancy_abort(char const*, int, char const*)
../../src/gcc/diagnostics/context.cc:1813
0x817319 set_defining_module(tree_node*)
../../src/gcc/cp/module.cc:22284
0xd98cb2 cp_parser_function_definition_after_declarator
../../src/gcc/cp/parser.cc:36490
0xdd0dde cp_parser_function_definition_from_specifiers_and_declarator
../../src/gcc/cp/parser.cc:36391
0xdd0dde cp_parser_init_declarator
../../src/gcc/cp/parser.cc:26283
0xdd12c5 cp_parser_single_declaration
../../src/gcc/cp/parser.cc:36895
0xdd1536 cp_parser_template_declaration_after_parameters
../../src/gcc/cp/parser.cc:36548
0xdd1536 cp_parser_explicit_template_declaration
../../src/gcc/cp/parser.cc:36722
0xdd224e cp_parser_template_declaration_after_export
../../src/gcc/cp/parser.cc:36741
0xdd224e cp_parser_explicit_specialization
../../src/gcc/cp/parser.cc:22456
0xde08b8 cp_parser_declaration
../../src/gcc/cp/parser.cc:17809
0xddf861 cp_parser_toplevel_declaration
../../src/gcc/cp/parser.cc:17923
0xddf861 cp_parser_declaration_seq_opt
../../src/gcc/cp/parser.cc:17628
0xddfd46 cp_parser_namespace_body
../../src/gcc/cp/parser.cc:24696
0xddfd46 cp_parser_namespace_definition
../../src/gcc/cp/parser.cc:24674
0xde0956 cp_parser_declaration
../../src/gcc/cp/parser.cc:17882
0xde345a cp_parser_toplevel_declaration
../../src/gcc/cp/parser.cc:17923
0xde345a cp_parser_translation_unit
../../src/gcc/cp/parser.cc:5685
0xde345a c_parse_file()
../../src/gcc/cp/parser.cc:58096
gcc/cc1plus -quiet -imultiarch x86_64-linux-gnu -iprefix
/home/iains/gcc-master/bld/gcc/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/ -isystem
gcc/include -isystem gcc/include-fixed -D_GNU_SOURCE ../use.C -quiet -dumpbase
use.C -dumpbase-ext .C -mtune=nehalem -march=x86-64 -std=c++29 -fmodules
-fno-module-include-translate -o /tmp/cccQvRrB.s
the interactions seem somewhat complex...
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99000
[Bug 99000] [modules] merging of textual redefinitions: declaration
std::__copy_move_a2 conflicts with import