]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: don't remove labels during coro-early-expand-ifns [PR105104]
authorArsen Arsenović <arsen@aarsen.me>
Fri, 16 Aug 2024 17:07:01 +0000 (19:07 +0200)
committerArsen Arsenović <arsen@gcc.gnu.org>
Thu, 29 Aug 2024 11:53:33 +0000 (13:53 +0200)
commitd9c54e9a036189e8961ec17e118fccf794d7bfab
treebc5519633349392ee78f596f22ffe38a7a376fde
parentbd2ccc24420c0789a3ad0b49d0ea4c2e7653afae
c++: don't remove labels during coro-early-expand-ifns [PR105104]

In some scenarios, it is possible for the CFG cleanup to cause one of
the labels mentioned in CO_YIELD, which coro-early-expand-ifns intends
to remove, to become part of some statement.  As a result, when that
label is removed, the statement it became part of becomes invalid,
crashing the compiler.

There doesn't appear to be a reason to remove the labels (anymore, at
least), so let's not do that.

PR c++/105104

gcc/ChangeLog:

* coroutine-passes.cc (execute_early_expand_coro_ifns): Don't
remove any labels.

gcc/testsuite/ChangeLog:

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