]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
coroutines: No cleanups on goto statements.
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 3 Mar 2021 16:13:00 +0000 (16:13 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Sun, 3 Oct 2021 19:19:33 +0000 (20:19 +0100)
Minor cleanup, this is statement not an expression, we do not
need to use finish_expr_stmt here.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/ChangeLog:

* coroutines.cc (await_statement_walker): Use build_stmt and
add_stmt instead of build1 and finish_expr_stmt.

(cherry picked from commit 8406ed9af2655479a9c8469d7acca2cf5784f5d6)

gcc/cp/coroutines.cc

index 6e3b8b2ba24ec4e09e4c5c53c4740e801b80a2db..3fe44e47a3d119e54da928b2c750066548ca16e0 100644 (file)
@@ -3826,8 +3826,8 @@ await_statement_walker (tree *stmt, int *do_subtree, void *d)
               the parameter to return_value().  */
            if (!maybe_await_stmt)
              maybe_await_stmt = tsi_stmt_ptr (tsi_last (ret_list));
-           expr = build1_loc (loc, GOTO_EXPR, void_type_node, awpts->fs_label);
-           finish_expr_stmt (expr);
+           TREE_USED (awpts->fs_label) = 1;
+           add_stmt (build_stmt (loc, GOTO_EXPR, awpts->fs_label));
            *stmt = pop_stmt_list (ret_list);
            /* Once this is complete, we will have processed subtrees.  */
            *do_subtree = 0;