aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2021-10-02 13:40:09 +0100
committerIain Sandoe <iain@sandoe.co.uk>2021-10-03 20:46:03 +0100
commit1b54a7226368bf86361e5c9d8ae523193037a0ac (patch)
tree804878fd3d978136f250c3b55a4fbc62d30345f6 /gcc/fortran/resolve.c
parent0ee1ab15c237ffb50be1a5ce9c5e542b16df4d12 (diff)
downloadgcc-1b54a7226368bf86361e5c9d8ae523193037a0ac.zip
gcc-1b54a7226368bf86361e5c9d8ae523193037a0ac.tar.gz
gcc-1b54a7226368bf86361e5c9d8ae523193037a0ac.tar.bz2
coroutines: Ensure co_await_exprs have TREE_SIDE_EFFECTS set [PR 101133].
Although it is not immediately evident from the symptoms, the PR is caused by a variable having a DECL_INITIAL() containing a co_await. This is not correct, since such expressions have side-effects. We were marking the overall co_await expression correctly, but if a consumer of that expression stripped out the underlying co_await_expr then the latter would not be properly marked. Fixed by marking both the underlying and any containing await expr with TREE_SIDE_EFFECTS. Also mark type-dependent co_await expressions. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> PR c++/101133 gcc/cp/ChangeLog: * coroutines.cc (build_co_await): Mark co_await_expr trees with TREE_SIDE_EFFECTS, also mark any containing expression. (finish_co_await_expr): Mark type-dependent co_await_expr trees with TREE_SIDE_EFFECTS. gcc/testsuite/ChangeLog: * g++.dg/coroutines/pr101133.C: New test.
Diffstat (limited to 'gcc/fortran/resolve.c')
0 files changed, 0 insertions, 0 deletions