diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-28 12:18:57 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-28 12:18:57 +0000 |
commit | 569d18a5474dc40432aa992cc5b600300e278d97 (patch) | |
tree | ed78d34a78eb25b4804dcb75880712505ce51a5f /gcc/testsuite/gcc.c-torture | |
parent | 4b72e6807dac8a30b65028b9286f9f0b85d806e7 (diff) | |
download | gcc-569d18a5474dc40432aa992cc5b600300e278d97.tar.gz |
PR tree-optimization/54713
* fold-const.c (vec_cst_ctor_to_array): Give up if vector CONSTRUCTOR
has vector elements.
(fold_ternary_loc) <case BIT_FIELD_REF>: Likewise.
* tree-vect-generic.c (vector_element): Don't rely on CONSTRUCTOR elts
indexes. Use BIT_FIELD_REF if CONSTRUCTOR has vector elements.
(lower_vec_perm): Use NULL_TREE CONSTRUCTOR indexes.
* gcc.c-torture/compile/pr54713-1.c: New test.
* gcc.c-torture/compile/pr54713-2.c: New test.
* gcc.c-torture/compile/pr54713-3.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191826 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr54713-1.c | 70 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr54713-2.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr54713-3.c | 9 |
3 files changed, 86 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr54713-1.c b/gcc/testsuite/gcc.c-torture/compile/pr54713-1.c new file mode 100644 index 00000000000..f042ea2fc6c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr54713-1.c @@ -0,0 +1,70 @@ +/* PR tree-optimization/54713 */ + +#ifndef N +#define N 8 +#define ONE 1, 1, 1, 1, 1, 1, 1, 1 +#define ONEU 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U +#endif + +typedef int V __attribute__((vector_size (N * sizeof (int)))); +typedef unsigned int W __attribute__((vector_size (N * sizeof (int)))); + +void +f1 (V *p) +{ + *p = (*p & ((V) { ONE })) ^ ((V) { ONE}); +} + +void +f2 (V *p) +{ + *p = (*p ^ ((V) { ONE })) & ((V) { ONE}); +} + +void +f3 (V *p) +{ + *p = (~*p) & ((V) { ONE }); +} + +void +f4 (V *p, V *q) +{ + *p = (*p ^ *q) == *q; +} + +void +f5 (V *p, V *q) +{ + *p = (*p ^ *q) == *p; +} + +void +f6 (V *p, V *q, V *r) +{ + *p = (*p & *r) == (*q & *r); +} + +void +f7 (V *p, V *q, V *r) +{ + *p = (*p & *r) == (*r & *q); +} + +void +f8 (V *p, V *q, V *r) +{ + *p = (*r & *p) == (*q & *r); +} + +void +f9 (V *p, V *q, V *r) +{ + *p = (*r & *p) == (*r & *q); +} + +void +f10 (W *p, W *q) +{ + *p = *p < (((const W) { ONEU }) << *q); +} diff --git a/gcc/testsuite/gcc.c-torture/compile/pr54713-2.c b/gcc/testsuite/gcc.c-torture/compile/pr54713-2.c new file mode 100644 index 00000000000..c3910373111 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr54713-2.c @@ -0,0 +1,7 @@ +/* PR tree-optimization/54713 */ + +#define N 16 +#define ONE 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +#define ONEU 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U + +#include "pr54713-1.c" diff --git a/gcc/testsuite/gcc.c-torture/compile/pr54713-3.c b/gcc/testsuite/gcc.c-torture/compile/pr54713-3.c new file mode 100644 index 00000000000..6164a5eec0e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr54713-3.c @@ -0,0 +1,9 @@ +/* PR tree-optimization/54713 */ + +#define N 32 +#define ONE 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +#define ONEU 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, \ + 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U, 1U + +#include "pr54713-1.c" |