The change to allow SLP of non-grouped accesses failed to check
for the case of mixing with grouped accesses.
PR tree-optimization/111915
* tree-vect-slp.cc (vect_build_slp_tree_1): Check all
accesses are either grouped or not.
* gcc.dg/vect/pr111915.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-fno-tree-vrp -fno-tree-dominator-opts -fno-tree-ccp" } */
+
+void
+foo (int * __restrict a, int * __restrict b, int * __restrict w)
+{
+ for (int i = 0; i < 16; ++i)
+ {
+ *a += w[2*i+0];
+ *b += w[2*i&1];
+ }
+}
|| rhs_code == INDIRECT_REF
|| rhs_code == COMPONENT_REF
|| rhs_code == MEM_REF)))
+ || (ldst_p
+ && (STMT_VINFO_GROUPED_ACCESS (stmt_info)
+ != STMT_VINFO_GROUPED_ACCESS (first_stmt_info)))
|| (ldst_p
&& (STMT_VINFO_GATHER_SCATTER_P (stmt_info)
!= STMT_VINFO_GATHER_SCATTER_P (first_stmt_info)))