This fixes updating of the step vectors when filling up to group_size.
2020-11-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/97753
* tree-vect-loop.c (vectorizable_induction): Fill vec_steps
when CSEing inside the group.
* gcc.dg/vect/pr97753.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-O3" } */
+
+long a[6];
+void d(int c)
+{
+ for (; c; c++)
+ for (int b = 0; b < 8; b++)
+ ((char *)&a[c])[b] = c;
+}
nivs = least_common_multiple (group_size,
const_nunits) / const_nunits;
for (; ivn < nivs; ++ivn)
- SLP_TREE_VEC_STMTS (slp_node)
- .quick_push (SLP_TREE_VEC_STMTS (slp_node)[0]);
+ {
+ SLP_TREE_VEC_STMTS (slp_node)
+ .quick_push (SLP_TREE_VEC_STMTS (slp_node)[0]);
+ vec_steps.safe_push (vec_steps[0]);
+ }
}
/* Re-use IVs when we can. We are generating further vector