diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-05-22 18:51:54 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-05-22 18:51:54 +0000 |
commit | d96999c66faa6198385f5bdfd24cd6579cc38e25 (patch) | |
tree | ac190183444200175ba69ab2d6aaf216d6806398 /libgomp | |
parent | 6c9208959c3c02852c720dd73ec539f60e596b3f (diff) | |
download | gcc-d96999c66faa6198385f5bdfd24cd6579cc38e25.tar.gz |
PR middle-end/80853
* omp-low.c (lower_reduction_clauses): Pass OMP_CLAUSE_PRIVATE
as last argument to build_outer_var_ref for pointer bases of array
section reductions.
* testsuite/libgomp.c/pr80853.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248344 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/pr80853.c | 29 |
2 files changed, 34 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 460605b1b8a..d49420aa90e 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2017-05-22 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/80853 + * testsuite/libgomp.c/pr80853.c: New test. + 2017-05-19 Thomas Schwinge <thomas@codesourcery.com> * testsuite/libgomp.oacc-c++/template-reduction.C: Update. diff --git a/libgomp/testsuite/libgomp.c/pr80853.c b/libgomp/testsuite/libgomp.c/pr80853.c new file mode 100644 index 00000000000..3c0ff10c875 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/pr80853.c @@ -0,0 +1,29 @@ +/* PR middle-end/80853 */ +/* { dg-do run } */ + +__attribute__((noinline, noclone)) void +foo (int *p) +{ + #pragma omp for reduction(+:p[:4]) + for (int i = 0; i < 64; i++) + { + p[0] += i; + p[1] += i / 2; + p[2] += 2 * i; + p[3] += 3 * i; + } +} + +int +main () +{ + int p[4] = { 0, 0, 0, 0 }; + #pragma omp parallel + foo (p); + if (p[0] != 63 * 64 / 2 + || p[1] != 31 * 32 + || p[2] != 63 * 64 + || p[3] != 3 * 63 * 64 / 2) + __builtin_abort (); + return 0; +} |