The following fixes a check that should have rejected vectorizing
a conversion between a mask and non-mask type. Those should be
done via pattern statements.
PR tree-optimization/109502
* tree-vect-stmts.cc (vectorizable_assignment): Fix
check for conversion between mask and non-mask types.
* gcc.dg/vect/pr109502.c: New testcase.
--- /dev/null
+/* { dg-do run } */
+/* { dg-additional-options "-O" } */
+
+unsigned g;
+
+unsigned
+foo (void)
+{
+ unsigned a = !g;
+ a += !(a % 6);
+ return a;
+}
+
+int
+main ()
+{
+ unsigned x = foo ();
+ if (x != 1)
+ __builtin_abort ();
+ return 0;
+}
GET_MODE_SIZE (TYPE_MODE (vectype_in)))))
return false;
- if (VECTOR_BOOLEAN_TYPE_P (vectype)
- && !VECTOR_BOOLEAN_TYPE_P (vectype_in))
+ if (VECTOR_BOOLEAN_TYPE_P (vectype) != VECTOR_BOOLEAN_TYPE_P (vectype_in))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,