https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110997
Bug ID: 110997 Summary: [13/14 Regression] internal compiler error: in cxx_eval_constant_expression, at cp/constexpr.cc:8005 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mpolacek at gcc dot gnu.org Target Milestone: --- While workin' on P2564 I found this ICE: // P2564R3 // { dg-do compile { target c++20 } } // From clang's cxx2b-consteval-propagate.cpp. This test ICEd when I worked on // P2564. consteval int f (int); struct S { int a = 0; int b = f (a); }; constexpr bool g (auto i) { S s{i}; return s.b == 2 *i; } consteval int f (int i) { return 2 * i; } void test () { static_assert(g(42)); } $ ./cc1plus -quiet -std=c++20 consteval-prop4.C consteval-prop4.C: In instantiation of ‘constexpr bool g(auto:1) [with auto:1 = int]’: consteval-prop4.C:29:18: required from here consteval-prop4.C:16:5: internal compiler error: in cxx_eval_constant_expression, at cp/constexpr.cc:8005 16 | S s{i}; | ^ 0xdb5f20 cxx_eval_constant_expression /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:8005 0xdac220 cxx_eval_indirect_ref /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:5735 0xdb3a7a cxx_eval_constant_expression /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:7471 0xda66a6 cxx_eval_component_reference /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:4363 0xdb4109 cxx_eval_constant_expression /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:7644 0xd9bc4a cxx_bind_parameters_in_call /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:1830 0xda093c cxx_eval_call_expression /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:2926 0xdb2626 cxx_eval_constant_expression /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:7196 0xdb8143 cxx_eval_outermost_constant_expr /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:8438 0xdb8dc8 cxx_constant_value(tree_node*, tree_node*, int) /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:8594 0x1133fda bot_replace /home/mpolacek/src/gcc/gcc/cp/tree.cc:3302 0x1df1281 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*)) /home/mpolacek/src/gcc/gcc/tree.cc:11341 0x113410d break_out_target_exprs(tree_node*, bool) /home/mpolacek/src/gcc/gcc/cp/tree.cc:3337 0xeca1b1 get_nsdmi(tree_node*, bool, int) /home/mpolacek/src/gcc/gcc/cp/init.cc:693 0x1189148 process_init_constructor_record /home/mpolacek/src/gcc/gcc/cp/typeck2.cc:1827 0x118a406 process_init_constructor /home/mpolacek/src/gcc/gcc/cp/typeck2.cc:2094 0x11874da digest_init_r /home/mpolacek/src/gcc/gcc/cp/typeck2.cc:1358 0x11876e9 digest_init_flags(tree_node*, tree_node*, int, int) /home/mpolacek/src/gcc/gcc/cp/typeck2.cc:1404 0x11852ac store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) /home/mpolacek/src/gcc/gcc/cp/typeck2.cc:848 0xe4f3af check_initializer /home/mpolacek/src/gcc/gcc/cp/decl.cc:7595