diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-05-26 10:05:39 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-05-26 10:05:39 +0000 |
commit | dd4c9153626c8f759c7c98aa37c7bae3038a6506 (patch) | |
tree | f59944ef14c9cd5762b2b1aa4597919c05fe14dc /libgomp | |
parent | 399e7c422f12b654ae882fa8e8e593d8d7614a03 (diff) |
Backported from mainline
2017-05-22 Jakub Jelinek <jakub@redhat.com>
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/branches/gcc-7-branch@248486 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 8 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.c/pr80853.c | 29 |
2 files changed, 37 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index ccea2287729a..8e3635bb6d98 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,11 @@ +2017-05-26 Jakub Jelinek <jakub@redhat.com> + + Backported from mainline + 2017-05-22 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/80853 + * testsuite/libgomp.c/pr80853.c: New test. + 2017-05-02 Release Manager * GCC 7.1.0 released. diff --git a/libgomp/testsuite/libgomp.c/pr80853.c b/libgomp/testsuite/libgomp.c/pr80853.c new file mode 100644 index 000000000000..3c0ff10c8755 --- /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; +} |