public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [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
@ 2022-01-16 14:44 asolokha at gmx dot com
2022-04-18 15:35 ` [Bug c++/104051] " iains at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: asolokha at gmx dot com @ 2022-01-16 14:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104051
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) ICEs
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<promise>::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 <typename T> struct task {
% g++-12.0.0 -fcoroutines -c yhcitpuk.cc
yhcitpuk.cc: In function 'task<std::vector<int> > 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*,
...)
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/tree.c:8702
0x68afad tree_operand_check_code(tree_node*, tree_code, int, char const*, int,
char const*)
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/tree.h:3950
0x68afad coro_diagnose_throwing_final_aw_expr
/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
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp/coroutines.cc:2532
0x9a4480 coro_rewrite_function_body
/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**)
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp/coroutines.cc:4451
0x9f4f84 finish_function(bool)
/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
/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
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp/parser.c:31089
0xaebd18 cp_parser_init_declarator
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp/parser.c:22518
0xac5f09 cp_parser_simple_declaration
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp/parser.c:15230
0xaf6f25 cp_parser_declaration
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp/parser.c:14916
0xaf78ea cp_parser_toplevel_declaration
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp/parser.c:14937
0xaf78ea cp_parser_translation_unit
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp/parser.c:4988
0xaf78ea c_parse_file()
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/cp/parser.c:47942
0xc2e10d c_common_parse_file()
/var/tmp/portage/sys-devel/gcc-12.0.0_p20220109/work/gcc-12-20220109/gcc/c-family/c-opts.c:1238
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/104051] [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
2022-01-16 14:44 [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 asolokha at gmx dot com
@ 2022-04-18 15:35 ` iains at gcc dot gnu.org
2022-04-28 12:55 ` cvs-commit at gcc dot gnu.org
2022-04-28 13:01 ` iains at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: iains at gcc dot gnu.org @ 2022-04-18 15:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104051
Iain Sandoe <iains at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2022-04-18
Assignee|unassigned at gcc dot gnu.org |iains at gcc dot gnu.org
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> ---
candidate patch:
https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593320.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/104051] [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
2022-01-16 14:44 [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 asolokha at gmx dot com
2022-04-18 15:35 ` [Bug c++/104051] " iains at gcc dot gnu.org
@ 2022-04-28 12:55 ` cvs-commit at gcc dot gnu.org
2022-04-28 13:01 ` iains at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-28 12:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104051
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:
https://gcc.gnu.org/g:7b96274a340bc0e9bcaef9baff3a44ec2f12c3df
commit r12-8310-g7b96274a340bc0e9bcaef9baff3a44ec2f12c3df
Author: Iain Sandoe <iain@sandoe.co.uk>
Date: Mon Apr 18 16:23:30 2022 +0100
c++, coroutines: Improve check for throwing final await [PR104051].
We check that the final_suspend () method returns a sane type (i.e. a class
or structure) but, unfortunately, that check has to be later than the one
for a throwing case. If the use returns some nonsensical type from the
method, we need to handle that in the checking for noexcept.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR c++/104051
gcc/cp/ChangeLog:
* coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
non-target expression inputs.
gcc/testsuite/ChangeLog:
* g++.dg/coroutines/pr104051.C: New test.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/104051] [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
2022-01-16 14:44 [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 asolokha at gmx dot com
2022-04-18 15:35 ` [Bug c++/104051] " iains at gcc dot gnu.org
2022-04-28 12:55 ` cvs-commit at gcc dot gnu.org
@ 2022-04-28 13:01 ` iains at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: iains at gcc dot gnu.org @ 2022-04-28 13:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104051
--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> ---
fixed for gcc-12, backports TBD.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-28 13:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-16 14:44 [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 asolokha at gmx dot com
2022-04-18 15:35 ` [Bug c++/104051] " iains at gcc dot gnu.org
2022-04-28 12:55 ` cvs-commit at gcc dot gnu.org
2022-04-28 13:01 ` iains at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).