https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103752
Bug ID: 103752
Summary: [12 Regression][ICE][modules] with import <string>
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: egor.pugin at gmail dot com
Target Milestone: ---
Created attachment 52017
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52017&action=edit
repro
export module x;
import <string>;
std::pair<std::string, std::string> environment;
gcc11 works fine, gcc from master gives an ICE.
In file included from
/home/egor/dev/gcc/build/install/include/c++/12.0.0/bits/stl_algobase.h:64,
from
/home/egor/dev/gcc/build/install/include/c++/12.0.0/bits/char_traits.h:39,
from
/home/egor/dev/gcc/build/install/include/c++/12.0.0/string:40,
of module /home/egor/dev/gcc/build/install/include/c++/12.0.0/string, imported
at crash.cpp:2:
/home/egor/dev/gcc/build/install/include/c++/12.0.0/bits/stl_pair.h: In
instantiation of ‘struct std::pair<std::__cxx11::basic_string<char>,
std::__cxx11::basic_string<char> >’:
crash.cpp:3:37: required from here
/home/egor/dev/gcc/build/install/include/c++/12.0.0/bits/stl_pair.h:242:7:
internal compiler error: Segmentation fault
242 | pair()
| ^~~~
0x1140a2f crash_signal
../../gcc/toplev.c:322
0xb01b55 hash_table_mod1(unsigned int, unsigned int)
../../gcc/hash-table.h:344
0xb01b55 hash_table<hash_map<tree_node*, tree_node*,
decl_tree_cache_traits>::hash_entry, false,
xcallocator>::find_with_hash(tree_node* const&, unsigned int)
../../gcc/hash-table.h:914
0xb01b55 hash_map<tree_node*, tree_node*,
decl_tree_cache_traits>::get(tree_node* const&)
../../gcc/hash-map.h:189
0xb01b55 lookup_explicit_specifier
../../gcc/cp/pt.c:13787
0xb01b55 tsubst_function_decl
../../gcc/cp/pt.c:14012
0xb051c2 tsubst_decl
../../gcc/cp/pt.c:14439
0xb33a79 instantiate_class_template_1
../../gcc/cp/pt.c:12020
0xb35112 instantiate_class_template(tree_node*)
../../gcc/cp/pt.c:12306
0xb83b79 complete_type(tree_node*)
../../gcc/cp/typeck.c:143
0x9b9055 start_decl_1(tree_node*, bool)
../../gcc/cp/decl.c:5771
0x9b9055 start_decl_1(tree_node*, bool)
../../gcc/cp/decl.c:5750
0x9d90b0 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
../../gcc/cp/decl.c:5737
0xaceda2 cp_parser_init_declarator
../../gcc/cp/parser.c:22529
0xaaa393 cp_parser_simple_declaration
../../gcc/cp/parser.c:15155
0xada635 cp_parser_declaration
../../gcc/cp/parser.c:14841
0xadb04a cp_parser_toplevel_declaration
../../gcc/cp/parser.c:14862
0xadb04a cp_parser_translation_unit
../../gcc/cp/parser.c:4986
0xadb04a c_parse_file()
../../gcc/cp/parser.c:47839
0xc0838d c_common_parse_file()
../../gcc/c-family/c-opts.c:1237
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.