aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-slp.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-06-16 08:56:21 +0200
committerRichard Biener <rguenther@suse.de>2021-06-16 08:58:28 +0200
commit4e56b1347687a33efa47d13d357ae3b7ab759c99 (patch)
tree82d3c41342896bbe0cf80b8b43a8523b85de0afd /gcc/tree-vect-slp.c
parentede6c3568f383f62df7bf9234212ee80763fdf6b (diff)
downloadgcc-4e56b1347687a33efa47d13d357ae3b7ab759c99.zip
gcc-4e56b1347687a33efa47d13d357ae3b7ab759c99.tar.gz
gcc-4e56b1347687a33efa47d13d357ae3b7ab759c99.tar.bz2
tree-optimization/101083 - fix ICE with SLP reassoc
This makes us pass down the vector type for the two-operand SLP node build rather than picking that from operand one which, when constant or external, could be NULL. 2021-06-16 Richard Biener <rguenther@suse.de> PR tree-optimization/101083 * tree-vect-slp.c (vect_slp_build_two_operator_nodes): Get vectype as argument. (vect_build_slp_tree_2): Adjust. * gcc.dg/vect/pr97832-4.c: New testcase.
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r--gcc/tree-vect-slp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 9ded585..8ec589b 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -1536,13 +1536,12 @@ vect_build_slp_tree (vec_info *vinfo,
/* Helper for building an associated SLP node chain. */
static void
-vect_slp_build_two_operator_nodes (slp_tree perm,
+vect_slp_build_two_operator_nodes (slp_tree perm, tree vectype,
slp_tree op0, slp_tree op1,
stmt_vec_info oper1, stmt_vec_info oper2,
vec<std::pair<unsigned, unsigned> > lperm)
{
unsigned group_size = SLP_TREE_LANES (op1);
- tree vectype = SLP_TREE_VECTYPE (op1);
slp_tree child1 = new _slp_tree;
SLP_TREE_DEF_TYPE (child1) = vect_internal_def;
@@ -2087,7 +2086,7 @@ vect_build_slp_tree_2 (vec_info *vinfo, slp_tree node,
for (unsigned lane = 0; lane < group_size; ++lane)
lperm.quick_push (std::make_pair
(chains[lane][i].code != chains[0][i].code, lane));
- vect_slp_build_two_operator_nodes (child, op0, op1,
+ vect_slp_build_two_operator_nodes (child, vectype, op0, op1,
(chains[0][i].code == code
? op_stmt_info
: other_op_stmt_info),