https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117773
Bug ID: 117773 Summary: ICE in gimplify_var_or_parm_decl, co_yleld Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: sberg.fun at gmail dot com Target Milestone: --- At least with recent GCC 15 trunk, > $ cat test.cc > #include <coroutine> > #include <initializer_list> > struct S { > struct promise_type { > S get_return_object(); > std::suspend_always initial_suspend(); > std::suspend_always final_suspend() noexcept; > std::suspend_always yield_value(int); > void unhandled_exception(); > }; > S(std::coroutine_handle<promise_type>); > }; > S f() { > for (int x: {0}) { > int y; > co_yield y; > } > } > $ g++ -std=c++23 -c test.cc > test.cc: In function ‘void f(_Z1fv.Frame*)’: > test.cc:16:18: internal compiler error: in gimplify_var_or_parm_decl, at > gimplify.cc:3315 > 16 | co_yield y; > | ^ > 0x25abe5e internal_error(char const*, ...) > ../../src/gcc/diagnostic-global-context.cc:517 > 0x709b9b fancy_abort(char const*, int, char const*) > ../../src/gcc/diagnostic.cc:1696 > 0x546bb8 gimplify_var_or_parm_decl > ../../src/gcc/gimplify.cc:3315 > 0xd26107 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), > int) > ../../src/gcc/gimplify.cc:19123 > 0xd3a084 gimplify_expr > ../../src/gcc/gimplify.cc:19747 > 0xd3a084 gimplify_arg(tree_node**, gimple**, unsigned int, bool) > ../../src/gcc/gimplify.cc:3801 > 0xd3a4aa gimplify_call_expr > ../../src/gcc/gimplify.cc:4212 > 0xd268cc gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), > int) > ../../src/gcc/gimplify.cc:18625 > 0xd2ebcc gimplify_stmt(tree_node**, gimple**) > ../../src/gcc/gimplify.cc:7839 > 0xd2ebcc gimplify_and_add(tree_node*, gimple**) > ../../src/gcc/gimplify.cc:518 > 0x79d653 cp_gimplify_expr(tree_node**, gimple**, gimple**) > ../../src/gcc/cp/cp-gimplify.cc:692 > 0xd255ad gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), > int) > ../../src/gcc/gimplify.cc:18562 > 0xd30dcc gimplify_cleanup_point_expr > ../../src/gcc/gimplify.cc:7839 > 0xd268ab gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), > int) > ../../src/gcc/gimplify.cc:19055 > 0xd286a4 gimplify_stmt(tree_node**, gimple**) > ../../src/gcc/gimplify.cc:7839 > 0xd2702b gimplify_statement_list > ../../src/gcc/gimplify.cc:2256 > 0xd2702b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), > int) > ../../src/gcc/gimplify.cc:19107 > 0xd286a4 gimplify_stmt(tree_node**, gimple**) > ../../src/gcc/gimplify.cc:7839 > 0xd297fe gimplify_bind_expr > ../../src/gcc/gimplify.cc:1651 > 0xd268dc gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), > int) > ../../src/gcc/gimplify.cc:18857