]> gcc.gnu.org Git - gcc.git/commit
openmp: Handle reduction clauses on host teams construct [PR96459]
authorJakub Jelinek <jakub@redhat.com>
Wed, 5 Aug 2020 08:40:10 +0000 (10:40 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 25 Aug 2020 14:32:45 +0000 (16:32 +0200)
commitfa6563471f5c9f96d2e446b15eb7aa770b4b4f17
tree2342dc6efaf4b37fedd429ef0d377219a78653bf
parente57cdbca52df908a48bbf92c64d50dd46f483de9
openmp: Handle reduction clauses on host teams construct [PR96459]

As the new testcase shows, we weren't actually performing reductions on
host teams construct.  And fixing that revealed a flaw in the for-14.c testcase.
The problem is that the tests perform also initialization and checking around the
calls to the functions with the OpenMP constructs.  In that testcase, all the
tests have been spawned from a teams construct but only the tested loops were
distribute, which means the initialization and checking has been performed
redundantly and racily in each team.  Fixed by performing the initialization
and checking outside of host teams and only do the calls to functions with
the tested constructs inside of host teams.

2020-08-05  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/96459
* omp-low.c (lower_omp_taskreg): Call lower_reduction_clauses even in
for host teams.

* testsuite/libgomp.c/teams-3.c: New test.
* testsuite/libgomp.c-c++-common/for-2.h (OMPTEAMS): Define to nothing
if not defined yet.
(N(test)): Use it before all N(f*) calls.
* testsuite/libgomp.c-c++-common/for-14.c (DO_PRAGMA, OMPTEAMS): Define.
(main): Don't call all test_* functions from within
#pragma omp teams reduction(|:err), call them directly.

(cherry picked from commit 916c7a201a9a1dc94f2c056a773826a26d1daca9)
gcc/omp-low.c
libgomp/testsuite/libgomp.c-c++-common/for-14.c
libgomp/testsuite/libgomp.c-c++-common/for-2.h
libgomp/testsuite/libgomp.c/teams-3.c [new file with mode: 0644]
This page took 0.067985 seconds and 6 git commands to generate.