The vectorizable_call part of r11-1143 dropped the required
vectype when moving from vect_get_vec_def_for_operand to
vect_get_vec_defs_for_operand. This caused an ICE on the
testcase for SVE, because we ended up with a non-predicate
value being passed to a predicate input.
AFAICT this was the only instance of that happening. The types
seemed to get carried forward for all the other converted calls.
gcc/
PR tree-optimization/97693
* tree-vect-stmts.c (vectorizable_call): Pass the required vectype
to vect_get_vec_defs_for_operand.
gcc/testsuite/
PR tree-optimization/97693
* gcc.dg/vect/pr97693.c: New test.
--- /dev/null
+/* { dg-do compile } */
+
+extern short a[];
+int b;
+short c, d;
+unsigned e() {
+ if (c)
+ return c;
+ return d;
+}
+void f() {
+ for (unsigned g = b; g; g += 6)
+ for (_Bool h = 0; h < (_Bool)e(); h = 1)
+ a[g] = 1 / b;
+}
{
vec_defs.quick_push (vNULL);
vect_get_vec_defs_for_operand (vinfo, stmt_info, ncopies,
- op, &vec_defs[i]);
+ op, &vec_defs[i],
+ vectypes[i]);
}
orig_vargs[i] = vargs[i] = vec_defs[i][j];
}