tree-optimization/109502 - vector conversion between mask and non-mask
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.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
/* { 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;
|
||||
}
|
||||
@@ -5595,8 +5595,7 @@ vectorizable_assignment (vec_info *vinfo,
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user