Commit af3cdd34 by Ilya Enkovich Committed by Ilya Enkovich

tree-vect-patterns.c (search_type_for_mask): Handle comparison of booleans.

gcc/

	* tree-vect-patterns.c (search_type_for_mask): Handle
	comparison of booleans.

gcc/testsuite/

	* gcc.dg/pr70026.c: New test.

From-SVN: r233966
parent 7ff6ca38
2016-03-04 Ilya Enkovich <enkovich.gnu@gmail.com>
* tree-vect-patterns.c (search_type_for_mask): Handle
comparison of booleans.
2016-03-04 Jakub Jelinek <jakub@redhat.com> 2016-03-04 Jakub Jelinek <jakub@redhat.com>
* doc/extend.texi (__builtin_alloca, __builtin_alloca_with_align): * doc/extend.texi (__builtin_alloca, __builtin_alloca_with_align):
......
2016-03-04 Ilya Enkovich <enkovich.gnu@gmail.com>
* gcc.dg/pr70026.c: New test.
2016-03-04 Marek Polacek <polacek@redhat.com> 2016-03-04 Marek Polacek <polacek@redhat.com>
PR c/69798 PR c/69798
......
/* { dg-do compile } */
/* { dg-options "-O3" } */
unsigned int a[64], b[64], c[64], d[64], e[64];
void
foo ()
{
int i;
for (i = 0; i < 64; i++)
{
d[i] = a[i];
e[i] = ((b[i] < e[i]) != !c[i]) && !a[i];
}
}
...@@ -3220,6 +3220,15 @@ search_type_for_mask (tree var, vec_info *vinfo) ...@@ -3220,6 +3220,15 @@ search_type_for_mask (tree var, vec_info *vinfo)
{ {
tree comp_vectype, mask_type; tree comp_vectype, mask_type;
if (TREE_CODE (TREE_TYPE (rhs1)) == BOOLEAN_TYPE)
{
res = search_type_for_mask (rhs1, vinfo);
res2 = search_type_for_mask (gimple_assign_rhs2 (def_stmt), vinfo);
if (!res || (res2 && TYPE_PRECISION (res) > TYPE_PRECISION (res2)))
res = res2;
break;
}
comp_vectype = get_vectype_for_scalar_type (TREE_TYPE (rhs1)); comp_vectype = get_vectype_for_scalar_type (TREE_TYPE (rhs1));
if (comp_vectype == NULL_TREE) if (comp_vectype == NULL_TREE)
return NULL_TREE; return NULL_TREE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment