Comment 4 for bug 1915640

Revision history for this message
Alexander Lelyakin (alexander-lelyakin) wrote :

On new version of g++-11, just compiled from trunk:
g++ (GCC) 11.0.0 20210223 (experimental)

Again in empty dir:
g++ -std=c++20 -fmodules-ts -x c++-system-header utility
g++ -std=c++20 -fmodules-ts -x c++-system-header algorithm
g++ -std=c++20 -fmodules-ts -x c++-system-header iostream
g++ -std=c++20 -fmodules-ts -x c++-system-header ranges
g++ -std=c++20 -fmodules-ts -x c++-system-header vector
g++ -std=c++20 -fmodules-ts -x c++-system-header array
g++ -std=c++20 -fmodules-ts -x c++-system-header string
g++ -std=c++20 -fmodules-ts -x c++-system-header functional

Result:
/usr/local/include/c++/11.0.0/functional:138:49: internal compiler error: in install_entity, at cp/module.cc:7584
  138 | using _Arity = integral_constant<size_t, 0>;
      | ^
0xa59f3d trees_in::install_entity(tree_node*)
 ../../gcc/gcc/cp/module.cc:7584
0xa63fda trees_in::decl_value()
 ../../gcc/gcc/cp/module.cc:8106
0xa65b47 trees_in::tree_node(bool)
 ../../gcc/gcc/cp/module.cc:9249
0xa6c303 module_state::read_cluster(unsigned int)
 ../../gcc/gcc/cp/module.cc:14943
0xa6c6ad module_state::load_section(unsigned int, binding_slot*)
 ../../gcc/gcc/cp/module.cc:18095
0xa6c76f module_state::lazy_load(unsigned int, binding_slot*)
 ../../gcc/gcc/cp/module.cc:18747
0xa669b0 trees_in::tree_node(bool)
 ../../gcc/gcc/cp/module.cc:9760
0xa68002 trees_in::lang_decl_vals(tree_node*)
 ../../gcc/gcc/cp/module.cc:6982
0xa63dba trees_in::tree_node_vals(tree_node*)
 ../../gcc/gcc/cp/module.cc:7175
0xa63dba trees_in::decl_value()
 ../../gcc/gcc/cp/module.cc:8068
0xa65b47 trees_in::tree_node(bool)
 ../../gcc/gcc/cp/module.cc:9249
0xa66cfc trees_in::chained_decls()
 ../../gcc/gcc/cp/module.cc:4954
0xa67aa9 trees_in::core_vals(tree_node*)
 ../../gcc/gcc/cp/module.cc:6656
0xa6df67 trees_in::tree_node_vals(tree_node*)
 ../../gcc/gcc/cp/module.cc:7173
0xa6df67 trees_in::tree_value()
 ../../gcc/gcc/cp/module.cc:9026
0xa6564f trees_in::tree_node(bool)
 ../../gcc/gcc/cp/module.cc:9244
0xa67ab7 trees_in::core_vals(tree_node*)
 ../../gcc/gcc/cp/module.cc:6658
0xa6df67 trees_in::tree_node_vals(tree_node*)
 ../../gcc/gcc/cp/module.cc:7173
0xa6df67 trees_in::tree_value()
 ../../gcc/gcc/cp/module.cc:9026
0xa6564f trees_in::tree_node(bool)
 ../../gcc/gcc/cp/module.cc:9244
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.

Sorry, I don't find a shorter sequence of system headers.
Every header is compilable when alone,
but if you do it in sequence in the same directory
after 5-7 system headers it usually crashes.

Another sequence:
g++ -std=c++20 -fmodules-ts -x c++-system-header concepts
g++ -std=c++20 -fmodules-ts -x c++-system-header functional
g++ -std=c++20 -fmodules-ts -x c++-system-header ranges
g++ -std=c++20 -fmodules-ts -x c++-system-header vector
g++ -std=c++20 -fmodules-ts -x c++-system-header string
g++ -std=c++20 -fmodules-ts -x c++-system-header algorithm
-------
In file included from /usr/local/include/c++/11.0.0/bits/functexcept.h:40,
                 from /usr/local/include/c++/11.0.0/bits/stl_algobase.h:60,
                 from /usr/local/include/c++/11.0.0/bits/char_traits.h:39,
                 from /usr/local/include/c++/11.0.0/string:40,
of module /usr/local/include/c++/11.0.0/string, imported at /usr/local/include/c++/11.0.0/bits/locale_classes.h:40,
        included from /usr/local/include/c++/11.0.0/bits/ios_base.h:41,
                 from /usr/local/include/c++/11.0.0/streambuf:41,
                 from /usr/local/include/c++/11.0.0/bits/streambuf_iterator.h:35,
                 from /usr/local/include/c++/11.0.0/iterator:66,
                 from /usr/local/include/c++/11.0.0/bits/ranges_algobase.h:36,
                 from /usr/local/include/c++/11.0.0/bits/ranges_algo.h:35,
                 from /usr/local/include/c++/11.0.0/algorithm:64:
/usr/local/include/c++/11.0.0/bits/locale_classes.h:461:11: internal compiler error: in duplicate_decls, at cp/decl.c:2023
  461 | __catch(...)
      | ^~~~~~~
0x6b37fc duplicate_decls(tree_node*, tree_node*, bool, bool)
 ../../gcc/gcc/cp/decl.c:2023
0xa83ceb check_module_override
 ../../gcc/gcc/cp/name-lookup.c:3615
0xa83ceb do_pushdecl
 ../../gcc/gcc/cp/name-lookup.c:3734
0xa848d1 do_pushdecl
 ../../gcc/gcc/cp/name-lookup.c:4851
0xa848d1 do_pushdecl_with_scope
 ../../gcc/gcc/cp/name-lookup.c:4851
0xa84b02 pushdecl_namespace_level(tree_node*, bool)
 ../../gcc/gcc/cp/name-lookup.c:6213
0xa85bf4 pushdecl_top_level(tree_node*)
 ../../gcc/gcc/cp/name-lookup.c:8675
0xa072b2 declare_library_fn
 ../../gcc/gcc/cp/except.c:172
0xa07e9d do_end_catch
 ../../gcc/gcc/cp/except.c:254
0xa07e9d push_eh_cleanup
 ../../gcc/gcc/cp/except.c:270
0xa07e9d expand_start_catch_block(tree_node*)
 ../../gcc/gcc/cp/except.c:408
0xb42764 finish_handler_parms(tree_node*, tree_node*)
 ../../gcc/gcc/cp/semantics.c:1526
0xac95a3 cp_parser_handler
 ../../gcc/gcc/cp/parser.c:27094
0xaa9bd7 cp_parser_handler_seq
 ../../gcc/gcc/cp/parser.c:27069
0xaa9bd7 cp_parser_try_block
 ../../gcc/gcc/cp/parser.c:27023
0xaa9bd7 cp_parser_statement
 ../../gcc/gcc/cp/parser.c:11654
0xaaaf3d cp_parser_statement_seq_opt
 ../../gcc/gcc/cp/parser.c:12112
0xaab018 cp_parser_compound_statement
 ../../gcc/gcc/cp/parser.c:12062
0xacaf9d cp_parser_implicitly_scoped_statement
 ../../gcc/gcc/cp/parser.c:13568
0xaaa65d cp_parser_selection_statement
 ../../gcc/gcc/cp/parser.c:12290
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.