Commit 0ec77a6c by Tamar Christina Committed by Tamar Christina

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
parent 57d4aea2
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> 2019-11-04 Martin Sebor <msebor@redhat.com>
PR tree-optimization/92349 PR tree-optimization/92349
...@@ -4149,7 +4149,7 @@ vect_remove_slp_scalar_calls (slp_tree node) ...@@ -4149,7 +4149,7 @@ vect_remove_slp_scalar_calls (slp_tree node)
void void
vectorize_slp_instance_root_stmt (slp_tree node, slp_instance instance) 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) if (SLP_TREE_NUMBER_OF_VEC_STMTS (node) == 1)
{ {
...@@ -4183,6 +4183,9 @@ vectorize_slp_instance_root_stmt (slp_tree node, slp_instance instance) ...@@ -4183,6 +4183,9 @@ vectorize_slp_instance_root_stmt (slp_tree node, slp_instance instance)
tree r_constructor = build_constructor (rtype, v); tree r_constructor = build_constructor (rtype, v);
rstmt = gimple_build_assign (lhs, r_constructor); rstmt = gimple_build_assign (lhs, r_constructor);
} }
gcc_assert (rstmt);
gimple_stmt_iterator rgsi = gsi_for_stmt (instance->root_stmt->stmt); gimple_stmt_iterator rgsi = gsi_for_stmt (instance->root_stmt->stmt);
gsi_replace (&rgsi, rstmt, true); gsi_replace (&rgsi, rstmt, true);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment