https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109185
Bug ID: 109185 Summary: ICE in get_partitioning_class, at symtab.cc:2096 Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: ice-on-valid-code, lto Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com CC: marxin at gcc dot gnu.org Target Milestone: --- gcc 13.0.1 20230312 snapshot (g:f23dc726875c26f2c38dfded453aa9beba0b9be9) ICEs when compiling the following testcase, reduced from test/SemaTemplate/instantiate-static-local.cpp from the clang 15 test suite, w/ -flto: namespace use_after_instantiation { template<int &R> struct A { static constexpr int &value = R; }; template<typename = void> auto S() { static int s; return A<s>{}; } auto &s = decltype(S())::value; } % g++-13 -flto -c rls6o5bx.cpp during IPA pass: modref rls6o5bx.cpp:10:1: internal compiler error: in get_partitioning_class, at symtab.cc:2096 10 | } | ^ 0x7a6b1d symtab_node::get_partitioning_class() /var/tmp/portage/sys-devel/gcc-13.0.1_p20230312/work/gcc-13-20230312/gcc/symtab.cc:2096 0x105d777 lto_output_varpool_node /var/tmp/portage/sys-devel/gcc-13.0.1_p20230312/work/gcc-13-20230312/gcc/lto-cgraph.cc:631 0x105d777 output_symtab() /var/tmp/portage/sys-devel/gcc-13.0.1_p20230312/work/gcc-13-20230312/gcc/lto-cgraph.cc:999 0x1074fdc lto_output() /var/tmp/portage/sys-devel/gcc-13.0.1_p20230312/work/gcc-13-20230312/gcc/lto-streamer-out.cc:2825 0x1103181 write_lto /var/tmp/portage/sys-devel/gcc-13.0.1_p20230312/work/gcc-13-20230312/gcc/passes.cc:2784 0x1103181 ipa_write_summaries_1 /var/tmp/portage/sys-devel/gcc-13.0.1_p20230312/work/gcc-13-20230312/gcc/passes.cc:2848 0x1103181 ipa_write_summaries() /var/tmp/portage/sys-devel/gcc-13.0.1_p20230312/work/gcc-13-20230312/gcc/passes.cc:2904 0xd3dd92 ipa_passes /var/tmp/portage/sys-devel/gcc-13.0.1_p20230312/work/gcc-13-20230312/gcc/cgraphunit.cc:2250 0xd3dd92 symbol_table::compile() /var/tmp/portage/sys-devel/gcc-13.0.1_p20230312/work/gcc-13-20230312/gcc/cgraphunit.cc:2323 0xd405e7 symbol_table::compile() /var/tmp/portage/sys-devel/gcc-13.0.1_p20230312/work/gcc-13-20230312/gcc/cgraphunit.cc:2303 0xd405e7 symbol_table::finalize_compilation_unit() /var/tmp/portage/sys-devel/gcc-13.0.1_p20230312/work/gcc-13-20230312/gcc/cgraphunit.cc:2575