diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e210eb5b80e9992bde79eab00f6769eaab4501eb..891ec79fcfd216b01f20420a1cb03f30a2c49f89 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-20  Marek Polacek  <polacek@redhat.com>
+
+	* coroutines.cc (captures_temporary): Don't assign the result of
+	STRIP_NOPS to the same variable.
+
 2020-04-20  Nathan Sidwell  <nathan@acm.org>
 
 	PR 94454 - tpl-tpl-parms are not canonicalizable types
diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index 0a8e7521c4f86d00610974dfcd890a9deefafd45..ceb8daa4e460160f90341664a56f58fb2aa03269 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -2652,7 +2652,7 @@ captures_temporary (tree *stmt, int *do_subtree, void *d)
 	  parm = TREE_OPERAND (parm, 0);
 	  if (TREE_CODE (parm) == INDIRECT_REF)
 	    parm = TREE_OPERAND (parm, 0);
-	  parm = STRIP_NOPS (parm);
+	  STRIP_NOPS (parm);
 	}
 
       /* This isn't a temporary.  */