summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-slp.c
diff options
context:
space:
mode:
authorRichard Biener <rguenth@gcc.gnu.org>2019-10-29 13:46:19 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-10-29 13:46:19 +0000
commit318bd8c60d83ca294b237559908dd9f88ee7c300 (patch)
treee7d041c184dd85ef4125c4541f0697a6fb8d5acb /gcc/tree-vect-slp.c
parent97c146036750e7cb3966d292572ec158a78f356e (diff)
re PR tree-optimization/92260 (ICE in exact_div, at poly-int.h:2162)
2019-10-29 Richard Biener <rguenther@suse.de> PR tree-optimization/92260 * tree-vect-slp.c (vect_get_constant_vectors): Special-case lane-reducing ops. * gcc.dg/pr92260.c: New testcase. From-SVN: r277571
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r--gcc/tree-vect-slp.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index b75594c36e9..9d65471ae70 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -3395,10 +3395,19 @@ vect_get_constant_vectors (slp_tree op_node, slp_tree slp_node,
else
vector_type = get_vectype_for_scalar_type (vinfo, TREE_TYPE (op));
- unsigned int number_of_vectors
- = vect_get_num_vectors (SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node)
- * TYPE_VECTOR_SUBPARTS (stmt_vectype),
- vector_type);
+ /* ??? For lane-reducing ops we should also have the required number
+ of vector stmts initialized rather than second-guessing here. */
+ unsigned int number_of_vectors;
+ if (is_gimple_assign (stmt_vinfo->stmt)
+ && (gimple_assign_rhs_code (stmt_vinfo->stmt) == SAD_EXPR
+ || gimple_assign_rhs_code (stmt_vinfo->stmt) == DOT_PROD_EXPR
+ || gimple_assign_rhs_code (stmt_vinfo->stmt) == WIDEN_SUM_EXPR))
+ number_of_vectors = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
+ else
+ number_of_vectors
+ = vect_get_num_vectors (SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node)
+ * TYPE_VECTOR_SUBPARTS (stmt_vectype),
+ vector_type);
vec_oprnds->create (number_of_vectors);
auto_vec<tree> voprnds (number_of_vectors);