]> git.ipfire.org Git - thirdparty/gcc.git/commit
coroutines: diagnose usage of alloca in coroutines
authorArsen Arsenović <arsen@aarsen.me>
Fri, 2 Aug 2024 11:17:40 +0000 (13:17 +0200)
committerArsen Arsenović <arsen@gcc.gnu.org>
Mon, 26 Aug 2024 20:31:38 +0000 (22:31 +0200)
commitc73d7f3c66c0b5865edd6880cd0d6be723cfbb8d
treef4cc6fb966f1563079bc44d63668bf0a402bdfd2
parent92c5265d22afaac146b2a7ecbc3dac9fc3382877
coroutines: diagnose usage of alloca in coroutines

We do not support it currently, and the resulting memory can only be
used inside a single resumption, so best not confuse the user with it.

PR c++/115858 - Incompatibility of coroutines and alloca()

gcc/ChangeLog:

* coroutine-passes.cc (execute_early_expand_coro_ifns): Emit a
sorry if a statement is an alloca call.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/pr115858.C: New test.
gcc/coroutine-passes.cc
gcc/testsuite/g++.dg/coroutines/pr115858.C [new file with mode: 0644]