SLP: Initialize variable to fix bootstrap after r277784.
authorTamar Christina <tamar.christina@arm.com>
Mon, 4 Nov 2019 19:25:20 +0000 (19:25 +0000)
committerTamar Christina <tnfchris@gcc.gnu.org>
Mon, 4 Nov 2019 19:25:20 +0000 (19:25 +0000)
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.

Committed under the gcc obvious rule.

gcc/ChangeLog:

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

From-SVN: r277788

gcc/ChangeLog
gcc/tree-vect-slp.c

index b8b120d..f29939a 100644 (file)
@@ -1,3 +1,7 @@
+2019-11-04  Tamar Christina  <tamar.christina@arm.com>
+
+       * tree-vect-slp.c (vectorize_slp_instance_root_stmt): Initialize rstmt.
+
 2019-11-04  Martin Sebor  <msebor@redhat.com>
 
        PR tree-optimization/92349
index 5549d05..f4b445a 100644 (file)
@@ -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);
 }