From 0ec77a6c25cbe321d9712e41a3aa04dff97eaaa6 Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Mon, 4 Nov 2019 19:25:20 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 4 ++++ gcc/tree-vect-slp.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b8b120d96ff..f29939a0dd8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2019-11-04 Tamar Christina + + * tree-vect-slp.c (vectorize_slp_instance_root_stmt): Initialize rstmt. + 2019-11-04 Martin Sebor PR tree-optimization/92349 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); } -- 2.30.2