https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107768

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This should fix the issue (just like what was done in PR 51045):

diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index 01a3e831ee5..96875425ba6 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -4131,7 +4131,7 @@ coro_rewrite_function_body (location_t fn_start, tree
fnbody, tree orig,
   /* We will need to be able to set the resume function pointer to nullptr
      to signal that the coroutine is 'done'.  */
   tree zero_resume
-    = build1 (CONVERT_EXPR, resume_fn_ptr_type, integer_zero_node);
+    = build1 (CONVERT_EXPR, resume_fn_ptr_type, nullptr_node);

   /* The pointer to the destroy function.  */
   tree var = coro_build_artificial_var (fn_start, coro_destroy_fn_id,
@@ -4518,7 +4518,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree
*destroyer)
   tree ramp_body = push_stmt_list ();

   tree zeroinit = build1_loc (fn_start, CONVERT_EXPR,
-                             coro_frame_ptr, integer_zero_node);
+                             coro_frame_ptr, nullptr_node);
   tree coro_fp = coro_build_artificial_var (fn_start, "_Coro_frameptr",
                                            coro_frame_ptr, orig, zeroinit);
   tree varlist = coro_fp;
@@ -4753,7 +4753,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree
*destroyer)

       gcc_checking_assert (same_type_p (fn_return_type, TREE_TYPE (grooaf)));
       tree if_stmt = begin_if_stmt ();
-      tree cond = build1 (CONVERT_EXPR, coro_frame_ptr, integer_zero_node);
+      tree cond = build1 (CONVERT_EXPR, coro_frame_ptr, nullptr_node);
       cond = build2 (EQ_EXPR, boolean_type_node, coro_fp, cond);
       finish_if_stmt_cond (cond, if_stmt);
       if (VOID_TYPE_P (fn_return_type))

Reply via email to