[gcc(refs/vendors/ARM/heads/morello)] cp: Fix two simple coroutines ICEs

Matthew Malcomson matmal01@gcc.gnu.org
Wed Apr 6 09:59:18 GMT 2022


https://gcc.gnu.org/g:02523e780aa9afba64abb81c4ed41b7b640a485d

commit 02523e780aa9afba64abb81c4ed41b7b640a485d
Author: Alex Coplan <alex.coplan@arm.com>
Date:   Mon Feb 21 10:30:48 2022 +0000

    cp: Fix two simple coroutines ICEs

Diff:
---
 gcc/cp/coroutines.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index 898b88b7075..5538449e603 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -3891,7 +3891,7 @@ coro_rewrite_function_body (location_t fn_start, tree fnbody,
 		       resume_fn_ptr_type);
   DECL_ARTIFICIAL (resume_fn_field) = true;
   tree zero_resume
-    = build1 (CONVERT_EXPR, resume_fn_ptr_type, integer_zero_node);
+    = build1 (CONVERT_EXPR, resume_fn_ptr_type, null_pointer_node);
   zero_resume
     = build2 (INIT_EXPR, resume_fn_ptr_type, resume_fn_field, zero_resume);
   finish_expr_stmt (zero_resume);
@@ -4180,7 +4180,7 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer)
   /* The decl_expr for the coro frame pointer, initialize to zero so that we
      can pass it to the IFN_CO_FRAME (since there's no way to pass a type,
      directly apparently).  This avoids a "used uninitialized" warning.  */
-  tree zeroinit = build1 (CONVERT_EXPR, coro_frame_ptr, integer_zero_node);
+  tree zeroinit = build1 (CONVERT_EXPR, coro_frame_ptr, null_pointer_node);
   DECL_INITIAL (coro_fp) = zeroinit;
   add_decl_expr (coro_fp);


More information about the Gcc-cvs mailing list