[Bug c++/99241] [modules] ICE in install_entity, at cp/module.cc:7584

2024-03-16 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99241

Patrick Palka  changed:

   What|Removed |Added

 CC||ppalka at gcc dot gnu.org

--- Comment #9 from Patrick Palka  ---
Reduced (needs -fno-module-lazy):

$ cat 99241_a.H
void terminate();

$ cat 99241_b.H
void terminate();

$ cat 99241_c.C
import "99242_a.H";
void terminate();
import "99242_b.H";

$ g++ -fmodules-ts -fno-module-lazy 99241_*
99242_c.H:3:20: internal compiler error: in install_entity, at
cp/module.cc:7649
3 | import "99242_b.H";
  |^
0x77821f trees_in::install_entity(tree_node*)

[Bug c++/99241] [modules] ICE in install_entity, at cp/module.cc:7584

2023-05-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99241

Andrew Pinski  changed:

   What|Removed |Added

 CC||saifi.khan at nishan dot io

--- Comment #8 from Andrew Pinski  ---
*** Bug 109981 has been marked as a duplicate of this bug. ***

[Bug c++/99241] [modules] ICE in install_entity, at cp/module.cc:7584

2022-10-22 Thread cgreeley at student dot bridgew.edu via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99241

--- Comment #7 from Christopher Greeley  
---
Created attachment 53759
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53759=edit
The pre processed header I tried to import into my module and the module code

This is the preprocessed header, -E on the module file only gives: 
"g++: warning: Source/Common.mpp: linker input file unused because linking not
done"

[Bug c++/99241] [modules] ICE in install_entity, at cp/module.cc:7584

2022-10-22 Thread cgreeley at student dot bridgew.edu via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99241

--- Comment #6 from Christopher Greeley  
---
When I say the compiler segfaulted, it is similar too:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99238

[Bug c++/99241] [modules] ICE in install_entity, at cp/module.cc:7584

2022-10-22 Thread cgreeley at student dot bridgew.edu via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99241

Christopher Greeley  changed:

   What|Removed |Added

 CC||cgreeley at student dot 
bridgew.ed
   ||u

--- Comment #5 from Christopher Greeley  
---
This is still an issue for me using the latest GCC 13 snapshot 
"gcc-latest_13.0.0-20221016git6366e3e8847a.deb"
from: https://jwakely.github.io/pkg-gcc-latest/

I was getting segfaults when compiling modules with 11/12.1/12.2

No more segfaults but importing some include files are giving me trouble namely
trying to include: 

https://github.com/peter-winter/ctpg/blob/6ab0502fc8cffa128bb8ff383f1c4b13cf21b86a/include/ctpg/ctpg.hpp

I am using xmake: 

https://tboox.org/2022/08/25/xmake-update-v2.7.1/

root@fe9917e74f33:~/workdir# xmake
[  0%]: generating.cxx.module.deps Source/Common.mpp
[ 26%]: generating.cxx.headerunit.bmi ctpg/ctpg.hpp
error: In file included from /opt/gcc-latest/include/c++/13.0.0/ios:43,
 from /opt/gcc-latest/include/c++/13.0.0/ostream:40,
 from
/root/.conan/data/ctpg/1.3.7/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/ctpg/ctpg.hpp:14:
/opt/gcc-latest/include/c++/13.0.0/bits/localefwd.h:156:48: internal compiler
error: in install_entity, at cp/module.cc:7611
  156 |   template >
  |^~~
0x9aeda3 trees_in::install_entity(tree_node*)
../../gcc/cp/module.cc:7611
0x9c04e1 trees_in::decl_value()
../../gcc/cp/module.cc:8125
0x9c2597 trees_in::tree_node(bool)
../../gcc/cp/module.cc:9325
0x9cb4db module_state::read_cluster(unsigned int)
../../gcc/cp/module.cc:15025
0x9cb895 module_state::load_section(unsigned int, binding_slot*)
../../gcc/cp/module.cc:18397
0x9cba77 lazy_load_binding(unsigned int, tree_node*, tree_node*, binding_slot*)
../../gcc/cp/module.cc:19105
0x9e0c52 name_lookup::search_namespace_only(tree_node*)
../../gcc/cp/name-lookup.cc:920
0x9e2bdb name_lookup::search_unqualified(tree_node*, cp_binding_level*)
../../gcc/cp/name-lookup.cc:1142
0x9eb283 lookup_name(tree_node*, LOOK_where, LOOK_want)
../../gcc/cp/name-lookup.cc:7562
0x9f793d lookup_name(tree_node*, LOOK_want)
../../gcc/cp/name-lookup.h:402
0x9f793d cp_parser_lookup_name
../../gcc/cp/parser.cc:30746
0xa3103e cp_parser_template_name
../../gcc/cp/parser.cc:18619
0xa31770 cp_parser_template_id
../../gcc/cp/parser.cc:18227
0xa3220e cp_parser_class_name
../../gcc/cp/parser.cc:25825
0xa2b23f cp_parser_qualifying_entity
../../gcc/cp/parser.cc:7186
0xa2b23f cp_parser_nested_name_specifier_opt
../../gcc/cp/parser.cc:6866
0xa27adc cp_parser_simple_type_specifier
../../gcc/cp/parser.cc:19805
0xa152ad cp_parser_type_specifier
../../gcc/cp/parser.cc:19463
0xa17155 cp_parser_type_specifier_seq
../../gcc/cp/parser.cc:24431
0xa23239 cp_parser_type_id_1
../../gcc/cp/parser.cc:24226
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

g++ (GCC) 13.0.0 20221016 (experimental)

GCC 12.1/12.2 was still giving me these problems, I think 11 did too.

[Bug c++/99241] [modules] ICE in install_entity, at cp/module.cc:7584

2021-04-08 Thread alexander.lelyakin at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99241

--- Comment #4 from Alexander Lelyakin  ---
The ICE in "install entity" can have different stacktrace. 
Stacktrace is same up to 'module_state::load_section'
but then it has at least two different variants:

1
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header memory
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header streambuf
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header regex

In file included from /usr/local/include/c++/11.0.1/sstream:38,
 from /usr/local/include/c++/11.0.1/regex:46:
/usr/local/include/c++/11.0.1/istream:58:42: internal compiler error: in
install_entity, at cp/module.cc:7468
   58 | class basic_istream : virtual public basic_ios<_CharT, _Traits>
  |  ^
0xa6f888 trees_in::install_entity(tree_node*)
../../gcc/gcc/cp/module.cc:7468
0xa77da6 trees_in::decl_value()
../../gcc/gcc/cp/module.cc:7980
0xa70767 trees_in::tree_node(bool)
../../gcc/gcc/cp/module.cc:9153
0xa76d8b module_state::read_cluster(unsigned int)
../../gcc/gcc/cp/module.cc:14811
0xa7728d module_state::load_section(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:18082
0xa7734f module_state::lazy_load(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:18740
0xa715d0 trees_in::tree_node(bool)
../../gcc/gcc/cp/module.cc:9664
0xa76a8b module_state::read_cluster(unsigned int)
../../gcc/gcc/cp/module.cc:14717
0xa7728d module_state::load_section(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:18082
0xa77448 lazy_load_binding(unsigned int, tree_node*, tree_node*, binding_slot*)
../../gcc/gcc/cp/module.cc:18773
0xa8906e name_lookup::search_namespace_only(tree_node*)
../../gcc/gcc/cp/name-lookup.c:928
0xa8a6bb name_lookup::search_unqualified(tree_node*, cp_binding_level*)
../../gcc/gcc/cp/name-lookup.c:1158
0xa8d3c4 lookup_name_1
../../gcc/gcc/cp/name-lookup.c:7804
0xa8d5aa lookup_name(tree_node*, LOOK_where, LOOK_want)
../../gcc/gcc/cp/name-lookup.c:7824
0xa9c282 lookup_name(tree_node*, LOOK_want)
../../gcc/gcc/cp/name-lookup.h:401
0xa9c282 cp_parser_lookup_name
../../gcc/gcc/cp/parser.c:29386
0xac4eef cp_parser_template_name
../../gcc/gcc/cp/parser.c:17711
0xac5432 cp_parser_template_id
../../gcc/gcc/cp/parser.c:17326
0xac5d4b cp_parser_class_name
../../gcc/gcc/cp/parser.c:24703
0xabd1fa cp_parser_qualifying_entity
../../gcc/gcc/cp/parser.c:7002
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

and compare:

2
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header array
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header stdexcept
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header valarray

In file included from /usr/local/include/c++/11.0.1/bits/hashtable.h:35,
 from /usr/local/include/c++/11.0.1/unordered_map:46,
 from /usr/local/include/c++/11.0.1/functional:61,
 from
/usr/local/include/c++/11.0.1/pstl/glue_algorithm_defs.h:13,
 from /usr/local/include/c++/11.0.1/algorithm:74,
 from /usr/local/include/c++/11.0.1/valarray:38:
/usr/local/include/c++/11.0.1/bits/hashtable_policy.h:63:51: internal compiler
error: in install_entity, at cp/module.cc:7468
   63 | inline typename std::iterator_traits<_Iterator>::difference_type
  |   ^
0xa6f888 trees_in::install_entity(tree_node*)
../../gcc/gcc/cp/module.cc:7468
0xa77da6 trees_in::decl_value()
../../gcc/gcc/cp/module.cc:7980
0xa70767 trees_in::tree_node(bool)
../../gcc/gcc/cp/module.cc:9153
0xa76d8b module_state::read_cluster(unsigned int)
../../gcc/gcc/cp/module.cc:14811
0xa7728d module_state::load_section(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:18082
0xa7734f module_state::lazy_load(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:18740
0xa715d0 trees_in::tree_node(bool)
../../gcc/gcc/cp/module.cc:9664
0xa76a8b module_state::read_cluster(unsigned int)
../../gcc/gcc/cp/module.cc:14717
0xa7728d module_state::load_section(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:18082
0xa7734f module_state::lazy_load(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:18740
0xa715d0 trees_in::tree_node(bool)
../../gcc/gcc/cp/module.cc:9664
0xa76a8b module_state::read_cluster(unsigned int)
../../gcc/gcc/cp/module.cc:14717
0xa7728d module_state::load_section(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:18082
0xa7734f module_state::lazy_load(unsigned int, binding_slot*)

[Bug c++/99241] [modules] ICE in install_entity, at cp/module.cc:7584

2021-03-31 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99241

--- Comment #3 from Marek Polacek  ---
*** Bug 99223 has been marked as a duplicate of this bug. ***

[Bug c++/99241] [modules] ICE in install_entity, at cp/module.cc:7584

2021-03-24 Thread alexander.lelyakin at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99241

--- Comment #2 from Alexander Lelyakin  ---
There is a shorter sequence:

/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header stdexcept
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header string
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header
condition_variable

In file included from /usr/local/include/c++/11.0.1/bits/ios_base.h:41,
 from /usr/local/include/c++/11.0.1/ios:42,
 from /usr/local/include/c++/11.0.1/ostream:38,
 from /usr/local/include/c++/11.0.1/bits/unique_ptr.h:42,
 from /usr/local/include/c++/11.0.1/bits/shared_ptr_base.h:59,
 from /usr/local/include/c++/11.0.1/bits/shared_ptr.h:53,
 from /usr/local/include/c++/11.0.1/condition_variable:43:
/usr/local/include/c++/11.0.1/bits/locale_classes.h:163:23: internal compiler
error: in install_entity, at cp/module.cc:7457
  163 | locale(const std::string& __s) : locale(__s.c_str()) { }
  |   ^~
0xa68138 trees_in::install_entity(tree_node*)
../../gcc/gcc/cp/module.cc:7457
0xa7063b trees_in::decl_value()
../../gcc/gcc/cp/module.cc:8009
0xa69017 trees_in::tree_node(bool)
../../gcc/gcc/cp/module.cc:9189
0xa6f61b module_state::read_cluster(unsigned int)
../../gcc/gcc/cp/module.cc:14846
0xa6fb1d module_state::load_section(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:18117
0xa6fbdf module_state::lazy_load(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:18778
0xa69e80 trees_in::tree_node(bool)
../../gcc/gcc/cp/module.cc:9700
0xa6b4d2 trees_in::lang_decl_vals(tree_node*)
../../gcc/gcc/cp/module.cc:6860
0xa703ea trees_in::tree_node_vals(tree_node*)
../../gcc/gcc/cp/module.cc:7053
0xa703ea trees_in::decl_value()
../../gcc/gcc/cp/module.cc:7962
0xa69017 trees_in::tree_node(bool)
../../gcc/gcc/cp/module.cc:9189
0xa6a1cc trees_in::chained_decls()
../../gcc/gcc/cp/module.cc:4832
0xa6af79 trees_in::core_vals(tree_node*)
../../gcc/gcc/cp/module.cc:6534
0xa686e7 trees_in::tree_node_vals(tree_node*)
../../gcc/gcc/cp/module.cc:7051
0xa686e7 trees_in::tree_value()
../../gcc/gcc/cp/module.cc:8966
0xa68b1f trees_in::tree_node(bool)
../../gcc/gcc/cp/module.cc:9184
0xa6af87 trees_in::core_vals(tree_node*)
../../gcc/gcc/cp/module.cc:6536
0xa686e7 trees_in::tree_node_vals(tree_node*)
../../gcc/gcc/cp/module.cc:7051
0xa686e7 trees_in::tree_value()
../../gcc/gcc/cp/module.cc:8966
0xa68b1f trees_in::tree_node(bool)
../../gcc/gcc/cp/module.cc:9184
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

g++ (GCC) 11.0.1 20210324 (experimental)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[Bug c++/99241] [modules] ICE in install_entity, at cp/module.cc:7584

2021-02-28 Thread alexander.lelyakin at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99241

--- Comment #1 from Alexander Lelyakin  ---
There is a shorter sequence:

g++ -std=c++20 -fmodules-ts -x c++-system-header forward_list
g++ -std=c++20 -fmodules-ts -x c++-system-header ios
g++ -std=c++20 -fmodules-ts -x c++-system-header unordered_map
g++ -std=c++20 -fmodules-ts -x c++-system-header condition_variable
g++ -std=c++20 -fmodules-ts -x c++-system-header regex

In file included from /usr/local/include/c++/11.0.1/bits/unique_ptr.h:42,
 from /usr/local/include/c++/11.0.1/bits/locale_conv.h:41,
 from /usr/local/include/c++/11.0.1/locale:43,
 from /usr/local/include/c++/11.0.1/regex:44:
/usr/local/include/c++/11.0.1/ostream:58:42: internal compiler error: in
install_entity, at cp/module.cc:7586
   58 | class basic_ostream : virtual public basic_ios<_CharT, _Traits>
  |  ^
0xa5a52d trees_in::install_entity(tree_node*)
../../gcc/gcc/cp/module.cc:7586
0xa647aa trees_in::decl_value()
../../gcc/gcc/cp/module.cc:8108
0xa66317 trees_in::tree_node(bool)
../../gcc/gcc/cp/module.cc:9251
0xa6cad3 module_state::read_cluster(unsigned int)
../../gcc/gcc/cp/module.cc:14948
0xa6ce7d module_state::load_section(unsigned int, binding_slot*)
../../gcc/gcc/cp/module.cc:18148
0xa6d518 lazy_load_binding(unsigned int, tree_node*, tree_node*, binding_slot*)
../../gcc/gcc/cp/module.cc:18833
0xa7d39e name_lookup::search_namespace_only(tree_node*)
../../gcc/gcc/cp/name-lookup.c:924
0xa7eafb name_lookup::search_unqualified(tree_node*, cp_binding_level*)
../../gcc/gcc/cp/name-lookup.c:1155
0xa818f4 lookup_name_1
../../gcc/gcc/cp/name-lookup.c:7868
0xa81aba lookup_name(tree_node*, LOOK_where, LOOK_want)
../../gcc/gcc/cp/name-lookup.c:7888
0xa907d2 lookup_name(tree_node*, LOOK_want)
../../gcc/gcc/cp/name-lookup.h:412
0xa907d2 cp_parser_lookup_name
../../gcc/gcc/cp/parser.c:29339
0xab901f cp_parser_template_name
../../gcc/gcc/cp/parser.c:17694
0xab955f cp_parser_template_id
../../gcc/gcc/cp/parser.c:17303
0xab9dbb cp_parser_class_name
../../gcc/gcc/cp/parser.c:24671
0xab134a cp_parser_qualifying_entity
../../gcc/gcc/cp/parser.c:6994
0xab134a cp_parser_nested_name_specifier_opt
../../gcc/gcc/cp/parser.c:6676
0xaa51dc cp_parser_base_specifier
../../gcc/gcc/cp/parser.c:26690
0xaa51dc cp_parser_base_clause
../../gcc/gcc/cp/parser.c:26543
0xaa51dc cp_parser_class_head
../../gcc/gcc/cp/parser.c:25630
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

g++ (GCC) 11.0.1 20210228 (experimental)