The following adds missing verification that the input vectors
have the same number of elements for vectorizable_operation.
2022-04-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/105132
* tree-vect-stmts.cc (vectorizable_operation): Check that
the input vectors have the same number of elements.
* gcc.dg/torture/pr105132.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-march=skylake-avx512" { target x86_64-*-* i?86-*-* } } */
+
+short a;
+extern int b[];
+int c;
+void d(long f[][5][5][17], int g[][5][5][17]) {
+ for (short e = 0; e < 17; e++) {
+ a = g[19][2][3][e];
+ b[e] = c & (f[3][2][3][e] && g[19][2][3][e]);
+ }
+}
"use not simple.\n");
return false;
}
+ if (vectype2
+ && maybe_ne (nunits_out, TYPE_VECTOR_SUBPARTS (vectype2)))
+ return false;
}
if (op_type == ternary_op)
{
"use not simple.\n");
return false;
}
+ if (vectype3
+ && maybe_ne (nunits_out, TYPE_VECTOR_SUBPARTS (vectype3)))
+ return false;
}
/* Multiple types in SLP are handled by creating the appropriate number of