coroutines: Update TREE_SIDE_EFFECTS on inserted bind exprs.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 3 May 2020 13:20:13 +0000 (14:20 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 8 May 2020 19:45:31 +0000 (20:45 +0100)
commit234681eadf2c51d7b78270188d64601b7267330d
treece8493990ed194e757ae76291a4e965858b30cac
parent810a2bd8784d745e1b446fb13ce56bee3be16b81
coroutines: Update TREE_SIDE_EFFECTS on inserted bind exprs.

There are several places where we insert bind expressions while
making the coroutine AST transforms.  These should be marked as
having side-effects where relevant, which had been omitted.  This
leads to at least one failure in the cppcoros test suite, where a loop
body is dropped in gimplification because it is not marked.

gcc/cp/ChangeLog:

2020-05-08  Iain Sandoe  <iain@sandoe.co.uk>

PR c++/95003
* coroutines.cc (build_actor_fn): Ensure that bind scopes
are marked as having side-effects where necessary.
(replace_statement_captures): Likewise.
(morph_fn_to_coro): Likewise.

gcc/testsuite/ChangeLog:

2020-05-08  Iain Sandoe  <iain@sandoe.co.uk>

PR c++/95003
* g++.dg/coroutines/torture/pr95003.C: New test.
gcc/cp/ChangeLog
gcc/cp/coroutines.cc
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/coroutines/torture/pr95003.C [new file with mode: 0644]