diff options
author | Bin Cheng <bin.cheng@arm.com> | 2016-08-12 14:58:20 +0000 |
---|---|---|
committer | Bin Cheng <amker@gcc.gnu.org> | 2016-08-12 14:58:20 +0000 |
commit | 8eb414aa6c71225d941e24572d5cdd9ce6feee50 (patch) | |
tree | 76c0c614276dff79f9625c824647a2b0964743e1 /gcc/testsuite/gcc.dg | |
parent | 30b39c1927a4d8d6c37c7fe774b1f09fea3aae51 (diff) | |
download | gcc-8eb414aa6c71225d941e24572d5cdd9ce6feee50.zip gcc-8eb414aa6c71225d941e24572d5cdd9ce6feee50.tar.gz gcc-8eb414aa6c71225d941e24572d5cdd9ce6feee50.tar.bz2 |
re PR tree-optimization/69848 (poor vectorization of a loop from SPEC2006 464.h264ref)
PR tree-optimization/69848
* tree-vectorizer.h (enum vect_def_type): New condition reduction
type CONST_COND_REDUCTION.
* tree-vect-loop.c (vectorizable_reduction): Support new condition
reudction type CONST_COND_REDUCTION.
gcc/testsuite
PR tree-optimization/69848
* gcc.dg/vect/vect-pr69848.c: New test.
From-SVN: r239416
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-pr69848.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/vect-pr69848.c b/gcc/testsuite/gcc.dg/vect/vect-pr69848.c new file mode 100644 index 0000000..779a657 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/vect-pr69848.c @@ -0,0 +1,37 @@ +/* { dg-require-effective-target vect_int } */ +/* { dg-require-effective-target vect_condition } */ +#include <stdarg.h> +#include "tree-vect.h" + +#define N 256 +int a[N] = {0}; + +__attribute__ ((noinline)) +int foo () +{ + int i, res = 0; + for (i = 0; i < N; i++) + { + if (a[i] != 0) + res = 1; + } + return res; +} + +int main (void) +{ + int i, res; + + check_vect (); + + if ((res = foo ()) != 0) + abort (); + + a[34] = 101; + a[85] = 9; + if ((res = foo ()) != 1) + abort (); + + return 0; +} +/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { xfail { ! vect_max_reduc } } } } */ |