summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-slp.c
diff options
context:
space:
mode:
authorTamar Christina <tamar.christina@arm.com>2019-11-04 19:25:20 +0000
committerTamar Christina <tnfchris@gcc.gnu.org>2019-11-04 19:25:20 +0000
commit0ec77a6c25cbe321d9712e41a3aa04dff97eaaa6 (patch)
tree5cfe6a6d83553401f905cae95a726f7a5e0db008 /gcc/tree-vect-slp.c
parent57d4aea2b45679f1846f81861172d78c28662726 (diff)
SLP: Initialize variable to fix bootstrap after r277784.
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
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r--gcc/tree-vect-slp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 5549d053bf3..f4b445ac1ef 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);
}