[committed,middle-end,SLP] Initialize variable to fix bootstrap after r277784.
diff mbox series

Message ID 20191104192713.GA23000@arm.com
State New
Headers show
Series
  • [committed,middle-end,SLP] Initialize variable to fix bootstrap after r277784.
Related show

Commit Message

Tamar Christina Nov. 4, 2019, 7:27 p.m. UTC
Hi All,

This initializes the rstmt variable with NULL and adds an assert to
check that a value has been given by one of the if cases before use.

This fixes the bootstrap failure due to -Werror.

Bootstrapped on aarch64-none-linux-gnu and no issues.

Committed under the gcc obvious rule.

gcc/ChangeLog:

2019-11-04  Tamar Christina  <tamar.christina@arm.com>

	* tree-vect-slp.c (vectorize_slp_instance_root_stmt): Initialize rstmt.

--

Patch
diff mbox series

diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 5549d053bf3cd102a4c4fcdc2e890c596927bd55..f4b445ac1ef9cff8280964dcc8937b3b74fe2a7c 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -4149,7 +4149,7 @@  vect_remove_slp_scalar_calls (slp_tree node)
 void
 vectorize_slp_instance_root_stmt (slp_tree node, slp_instance instance)
 {
-  gassign *rstmt;
+  gassign *rstmt = NULL;
 
   if (SLP_TREE_NUMBER_OF_VEC_STMTS (node) == 1)
     {
@@ -4183,6 +4183,9 @@  vectorize_slp_instance_root_stmt (slp_tree node, slp_instance instance)
       tree r_constructor = build_constructor (rtype, v);
       rstmt = gimple_build_assign (lhs, r_constructor);
     }
+
+    gcc_assert (rstmt);
+
     gimple_stmt_iterator rgsi = gsi_for_stmt (instance->root_stmt->stmt);
     gsi_replace (&rgsi, rstmt, true);
 }