diff mbox series

[pushed] coroutines : Add a missed begin/finish else clause to the codegen.

Message ID 0A8BADF1-4ECD-43D0-924D-D6EAA932E835@sandoe.co.uk
State New
Headers show
Series [pushed] coroutines : Add a missed begin/finish else clause to the codegen. | expand

Commit Message

Iain Sandoe Sept. 1, 2021, 1:28 p.m. UTC
Hi,

Minor code-gen correction.

tested on x86_64, powerpc64 - linux, x86_64-darwin,
pushed to master as trivial/obvious, thanks
Iain

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/cp/ChangeLog:

	* coroutines.cc (build_actor_fn): Add begin/finish clauses
	to the initial test in the actor function.
---
 gcc/cp/coroutines.cc | 2 ++
 1 file changed, 2 insertions(+)

--
diff mbox series

Patch

diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index 3bb33cc9eb9..ceb3d3be75e 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -2331,6 +2331,7 @@  build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody,
   finish_switch_stmt (destroy_dispatcher);
 
   finish_then_clause (lsb_if);
+  begin_else_clause (lsb_if);
 
   tree dispatcher = begin_switch_stmt ();
   finish_switch_cond (rat, dispatcher);
@@ -2368,6 +2369,7 @@  build_actor_fn (location_t loc, tree coro_frame_type, tree actor, tree fnbody,
 
   /* Insert the prototype dispatcher.  */
   finish_switch_stmt (dispatcher);
+  finish_else_clause (lsb_if);
 
   finish_if_stmt (lsb_if);