From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BE3473858D3C; Sun, 16 Jan 2022 14:44:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE3473858D3C From: "asolokha at gmx dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104051] New: [coroutines] ICE: tree check: expected target_expr, have call_expr in coro_diagnose_throwing_final_aw_expr, at cp/coroutines.cc:880 since r11-7528-g9ee91079fd5879cb Date: Sun, 16 Jan 2022 14:44:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: asolokha at gmx dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2022 14:44:19 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104051 Bug ID: 104051 Summary: [coroutines] ICE: tree check: expected target_expr, have call_expr in coro_diagnose_throwing_final_aw_expr, at cp/coroutines.cc:880 since r11-7528-g9ee91079fd5879cb Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com CC: unassigned at gcc dot gnu.org Target Milestone: --- +++ This bug was initially created as a clone of Bug #104050 +++ g++ 12.0.0 20220109 snapshot (g:49d73c9fb644673323845efebfe6b3106e70af8a) I= CEs when compiling the testcase from PR104050 w/ the following modification applied: % diff -u mfytqxkl.cc yhcitpuk.cc --- mfytqxkl.cc 2022-01-16 21:37:48.356869976 +0700 +++ yhcitpuk.cc 2022-01-16 21:37:52.201613444 +0700 @@ -12,7 +12,7 @@ return std::coroutine_handle::from_promise(*this); } auto initial_suspend() { return std::suspend_always(); } - auto final_suspend() noexcept { return final_awaitable(); } + auto final_suspend() noexcept { return true; } void unhandled_exception(); }; template struct task { % g++-12.0.0 -fcoroutines -c yhcitpuk.cc yhcitpuk.cc: In function 'task > foo()': yhcitpuk.cc:28:1: internal compiler error: tree check: expected target_expr, have call_expr in coro_diagnose_throwing_final_aw_expr, at cp/coroutines.cc= :880 28 | } | ^ 0x86d620 tree_check_failed(tree_node const*, char const*, int, char const*, ...) =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/tr= ee.c:8702 0x68afad tree_operand_check_code(tree_node*, tree_code, int, char const*, i= nt, char const*) =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/tr= ee.h:3950 0x68afad coro_diagnose_throwing_final_aw_expr =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp= /coroutines.cc:880 0x9a20b5 build_init_or_final_await =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp= /coroutines.cc:2532 0x9a4480 coro_rewrite_function_body =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp= /coroutines.cc:4304 0x9a9f43 morph_fn_to_coro(tree_node*, tree_node**, tree_node**) =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp= /coroutines.cc:4451 0x9f4f84 finish_function(bool) =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp= /decl.c:17600 0xaeaa99 cp_parser_function_definition_after_declarator =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp= /parser.c:31176 0xaebd18 cp_parser_function_definition_from_specifiers_and_declarator =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp= /parser.c:31089 0xaebd18 cp_parser_init_declarator =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp= /parser.c:22518 0xac5f09 cp_parser_simple_declaration =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp= /parser.c:15230 0xaf6f25 cp_parser_declaration =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp= /parser.c:14916 0xaf78ea cp_parser_toplevel_declaration =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp= /parser.c:14937 0xaf78ea cp_parser_translation_unit =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp= /parser.c:4988 0xaf78ea c_parse_file() =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp= /parser.c:47942 0xc2e10d c_common_parse_file() =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/c-= family/c-opts.c:1238=