https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109682
Bug ID: 109682
Summary: coroutines: ICE in morph_fn_to_coro on wrong return
type for get_return_object_on_allocation_failure
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dv at vollmann dot ch
Target Milestone: ---
Created attachment 54961
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54961&action=edit
Preprocessed source
Returning not the expected return type from
get_return_object_on_allocation_failure causes an internal compiler error:
g++ -std=c++23 wrong-promise-type-ice.cc
wrong-promise-type-ice.cc: In function 'CoHandle produce(QType&)':
wrong-promise-type-ice.cc:155:1: internal compiler error: in morph_fn_to_coro,
at cp/coroutines.cc:4766
155 | }
| ^
0x70d904 morph_fn_to_coro(tree_node*, tree_node**, tree_node**)
/build/src/gcc/gcc/cp/coroutines.cc:4766
0xa65905 finish_function(bool)
/build/src/gcc/gcc/cp/decl.cc:18082
0xb64697 cp_parser_function_definition_after_declarator
/build/src/gcc/gcc/cp/parser.cc:32049
0xb65b73 cp_parser_function_definition_from_specifiers_and_declarator
/build/src/gcc/gcc/cp/parser.cc:31963
0xb65b73 cp_parser_init_declarator
/build/src/gcc/gcc/cp/parser.cc:22822
0xb3a178 cp_parser_simple_declaration
/build/src/gcc/gcc/cp/parser.cc:15435
0xb70353 cp_parser_declaration
/build/src/gcc/gcc/cp/parser.cc:15121
0xb70e4a cp_parser_toplevel_declaration
/build/src/gcc/gcc/cp/parser.cc:15142
0xb70e4a cp_parser_translation_unit
/build/src/gcc/gcc/cp/parser.cc:5131
0xb70e4a c_parse_file()
/build/src/gcc/gcc/cp/parser.cc:49627
0xcaf411 c_common_parse_file()
/build/src/gcc/gcc/c-family/c-opts.cc:1248
Version:
GNU C++23 (GCC) version 14.0.0 20230430 (experimental) (x86_64-pc-linux-gnu)
Configured with: /build/src/gcc/configure --prefix=/opt/native/gcc
--disable-nls --enable-languages=c,c++