diff options
author | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-08-24 13:14:17 +0000 |
---|---|---|
committer | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-08-24 13:14:17 +0000 |
commit | 345f9789a1dad3d8c981eccf7562676eade47395 (patch) | |
tree | e8ba4654c7ecc7f4b815ad5cbf25b654f1dd4526 /libgomp/testsuite | |
parent | 09fb74a33043e6893fbf0990cf3e777bbb6c8828 (diff) | |
download | gcc-345f9789a1dad3d8c981eccf7562676eade47395.tar.gz |
Optimize expand_omp_for_static_chunk for chunk_size one
2015-08-24 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/65468
* omp-low.c (expand_omp_for_static_chunk): Remove inner loop if
chunk_size is one.
* gcc.dg/gomp/static-chunk-size-one.c: New test.
* testsuite/libgomp.c/static-chunk-size-one.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227124 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp/testsuite')
-rw-r--r-- | libgomp/testsuite/libgomp.c/static-chunk-size-one.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/static-chunk-size-one.c b/libgomp/testsuite/libgomp.c/static-chunk-size-one.c new file mode 100644 index 00000000000..9ed7b83625a --- /dev/null +++ b/libgomp/testsuite/libgomp.c/static-chunk-size-one.c @@ -0,0 +1,23 @@ +extern void abort (); + +int +bar () +{ + int a = 0, i; + +#pragma omp parallel for num_threads (3) reduction (+:a) schedule(static, 1) + for (i = 0; i < 10; i++) + a += i; + + return a; +} + +int +main (void) +{ + int res; + res = bar (); + if (res != 45) + abort (); + return 0; +} |