diff options
author | ienkovich <ienkovich@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-03-04 13:49:54 +0000 |
---|---|---|
committer | ienkovich <ienkovich@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-03-04 13:49:54 +0000 |
commit | 268fbd56675a4ba1d5c81736974032830500e58a (patch) | |
tree | 38f0d831d9046ff5a804a681c6e7d0dc1ae4b7a8 | |
parent | 6560d1adcecef454646575c36a37220ba6f30988 (diff) | |
download | gcc-268fbd56675a4ba1d5c81736974032830500e58a.tar.gz |
gcc/
* tree-vect-patterns.c (search_type_for_mask): Handle
comparison of booleans.
gcc/testsuite/
* gcc.dg/pr70026.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233966 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr70026.c | 15 | ||||
-rw-r--r-- | gcc/tree-vect-patterns.c | 9 |
4 files changed, 34 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 828f6081633..551044c1c07 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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> * doc/extend.texi (__builtin_alloca, __builtin_alloca_with_align): diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7a05cd30a4f..5faeb8617be 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-03-04 Ilya Enkovich <enkovich.gnu@gmail.com> + + * gcc.dg/pr70026.c: New test. + 2016-03-04 Marek Polacek <polacek@redhat.com> PR c/69798 diff --git a/gcc/testsuite/gcc.dg/pr70026.c b/gcc/testsuite/gcc.dg/pr70026.c new file mode 100644 index 00000000000..32f59e2d34f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr70026.c @@ -0,0 +1,15 @@ +/* { 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]; + } +} diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 4b3065ebb78..0ee5bbe8f46 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -3220,6 +3220,15 @@ search_type_for_mask (tree var, vec_info *vinfo) { 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)); if (comp_vectype == NULL_TREE) return NULL_TREE; |