https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94217
Bug ID: 94217 Summary: [10 Regression] ICE in ipa_find_agg_cst_for_param, at ipa-prop.c:3467 since r10-7237-g4e3d3e40726e1b68 Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: jakub at gcc dot gnu.org, marxin at gcc dot gnu.org, rguenth at gcc dot gnu.org Target Milestone: --- Related to the same revision as PR94216, but it's not fixed with https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94216#c1: $ cat star.ii template <typename _T2> struct A { A(int, _T2); }; template <typename, typename, typename, typename, typename = int> class B { struct C { C(B &p1) : _M_t(p1) {} template <typename _Arg> void operator()(_Arg) { _M_t._M_create_node(); } B &_M_t; }; void _M_create_node(); int _S_key() { } template <typename _Arg, typename _NodeGen> int _M_insert_(int *, int *, _Arg &&, _NodeGen &); public: template <typename _Arg> A<bool> _M_insert_unique(_Arg &&); }; template <typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> template <typename _Arg, typename _NodeGen> int B<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_(int *p1, int *p2, _Arg &&, _NodeGen &p4) { p1 || p2 || _S_key(); p4(0); } template <typename _Key, typename _Val, typename _KeyOfValue, typename _Compare, typename _Alloc> template <typename _Arg> A<bool> B<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique(_Arg &&) { int a; int *b; C c(*this); _M_insert_(&a, b, 0, c); return A<bool> (1, false); } struct IdIsoLanguageEntry; class D { public: typedef A<IdIsoLanguageEntry> value_type; B<int, int, int, int> _M_t; void insert(value_type p1) { _M_t._M_insert_unique(p1); } }; class F { public: F(const char *); }; enum { LANGUAGE_ENGLISH }; struct IdIsoLanguageEntry { int m_languageId; const char m_language[3]; F m_country; } d[]{LANGUAGE_ENGLISH, "", ""}; class IdIsoLanguageMap { public: IdIsoLanguageMap() { for (auto l : d) m_idLanguageMap.insert(D::value_type(l.m_languageId, l)); } D m_idLanguageMap; } e; $ g++ star.ii -c -flto -O2 -o x.o && gcc -shared x.o star.ii: In member function ‘int B< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3>, <template-parameter-1-4>, <template-parameter-1-5> >::_S_key()’: star.ii:9:19: warning: no return statement in function returning non-void [-Wreturn-type] 9 | int _S_key() { } | ^ star.ii: In member function ‘int B< <template-parameter-1-1>, <template-parameter-1-2>, <template-parameter-1-3>, <template-parameter-1-4>, <template-parameter-1-5> >::_M_insert_(int*, int*, _Arg&&, _NodeGen&)’: star.ii:24:1: warning: no return statement in function returning non-void [-Wreturn-type] 24 | } | ^ during IPA pass: cp lto1: internal compiler error: in ipa_find_agg_cst_for_param, at ipa-prop.c:3467 0xdc77e7 ipa_find_agg_cst_for_param(ipa_agg_value_set*, tree_node*, long, bool, bool*) /home/marxin/Programming/gcc/gcc/ipa-prop.c:3467 0xd87e7f evaluate_conditions_for_known_args /home/marxin/Programming/gcc/gcc/ipa-fnsummary.c:371 0xd93a6a estimate_ipcp_clone_size_and_time(cgraph_node*, vec<tree_node*, va_heap, vl_ptr>, vec<ipa_polymorphic_call_context, va_heap, vl_ptr>, vec<ipa_agg_value_set, va_heap, vl_ptr>, int*, sreal*, sreal*, int*) /home/marxin/Programming/gcc/gcc/ipa-fnsummary.c:3658 0x205c840 estimate_local_effects /home/marxin/Programming/gcc/gcc/ipa-cp.c:3478 0x205d78a propagate_constants_topo /home/marxin/Programming/gcc/gcc/ipa-cp.c:3816 0x205da33 ipcp_propagate_stage /home/marxin/Programming/gcc/gcc/ipa-cp.c:3912 0x206262e ipcp_driver /home/marxin/Programming/gcc/gcc/ipa-cp.c:5908 0x2062814 execute /home/marxin/Programming/gcc/gcc/ipa-cp.c:6001 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. lto-wrapper: fatal error: gcc returned 1 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status