https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123508
Bug ID: 123508
Summary: ICE: in gimplify_expr, at gimplify.cc with co_return
inside GNU statement expression
Product: gcc
Version: 15.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: 522024330006 at smail dot nju.edu.cn
Target Milestone: ---
Created attachment 63302
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63302&action=edit
Testcase
To reproduce: https://godbolt.org/z/neEafzxjh
The program is shown in the attachment.
GCC crashes with an internal compiler error (ICE) when a `co_return` statement
is used inside a GNU statement expression `({ ... })` within a coroutine.mid
Traceback:
```
internal compiler error: in gimplify_expr, at gimplify.cc:20381
33 | co_return ex;
| ^~~~~~~~~
0x5da1dc8 internal_error(char const*, ...)
/workspace/install/gcc/src/gcc/gcc/diagnostic-global-context.cc:517
0x5d3f858 fancy_abort(char const*, int, char const*)
/workspace/install/gcc/src/gcc/gcc/diagnostic.cc:1749
0x1f7769e gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:20381
0x1f1a2a6 gimplify_stmt(tree_node**, gimple**)
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:8458
0x1f18f27 gimplify_cleanup_point_expr
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:8196
0x1f74cec gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:19929
0x1f1a2a6 gimplify_stmt(tree_node**, gimple**)
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:8458
0x1ef2276 gimplify_statement_list
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:2285
0x1f752e1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:19981
0x1f1a2a6 gimplify_stmt(tree_node**, gimple**)
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:8458
0x1eee39b gimplify_bind_expr
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:1680
0x1f73475 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:19731
0x1f1a2a6 gimplify_stmt(tree_node**, gimple**)
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:8458
0x1ef2276 gimplify_statement_list
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:2285
0x1f752e1 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:19981
0x1f1a2a6 gimplify_stmt(tree_node**, gimple**)
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:8458
0x1f18f27 gimplify_cleanup_point_expr
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:8196
0x1f74cec gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:19929
0x1f1a2a6 gimplify_stmt(tree_node**, gimple**)
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:8458
0x1ef2276 gimplify_statement_list
/workspace/install/gcc/src/gcc/gcc/gimplify.cc:2285
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
```