[committed] coroutines: Avoid a maybe used uninitialized warning. NFC.

Message ID 48F36183-A69E-4A37-BD7C-8F33F033993B@sandoe.co.uk
State New
Headers show
Series
  • [committed] coroutines: Avoid a maybe used uninitialized warning. NFC.
Related show

Commit Message

Iain Sandoe May 17, 2020, 7:02 p.m.
Hi,

This avoids a (bogus) warning that occurs with some bootstrap
compilers.

tested on x86-64-darwin, x86-64-linux-gnu,
applied to master as obvious,
thanks
Iain

gcc/cp/ChangeLog:

2020-05-17  Iain Sandoe  <iain@sandoe.co.uk>

	* coroutines.cc (morph_fn_to_coro): Initialize the
	gro variable.
---
 gcc/cp/ChangeLog     | 4 ++++
 gcc/cp/coroutines.cc | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

-- 
2.24.1

Patch

diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7ac074a19b6..65fc6447e74 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@ 
+2020-05-17  Iain Sandoe  <iain@sandoe.co.uk>
+
+	* coroutines.cc (morph_fn_to_coro): Initialize the gro variable.
+
 2020-05-16  Iain Sandoe  <iain@sandoe.co.uk>
 
 	* coroutines.cc (finish_co_return_stmt): Implement rules
diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
index facfafaaa86..4cbc0e09994 100644
--- a/gcc/cp/coroutines.cc
+++ b/gcc/cp/coroutines.cc
@@ -4285,7 +4285,8 @@  morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer)
   tree gro_context_body = push_stmt_list ();
   bool gro_is_void_p = VOID_TYPE_P (TREE_TYPE (get_ro));
 
-  tree gro, gro_bind_vars = NULL_TREE;
+  tree gro = NULL_TREE;
+  tree gro_bind_vars = NULL_TREE;
   /* We have to sequence the call to get_return_object before initial
      suspend.  */
   if (gro_is_void_p)