openmp: Support allocate for C/C++ array section reductions
authorJakub Jelinek <jakub@redhat.com>
Fri, 13 Nov 2020 17:57:06 +0000 (18:57 +0100)
committerJakub Jelinek <jakub@redhat.com>
Fri, 13 Nov 2020 17:57:06 +0000 (18:57 +0100)
commit67100cb50ea22e1fc855360b887959f874fafe2c
tree8ef9baeb007dcce1c7d132966f7d819e6ce2ab72
parent2e97d6443f0a862ce9b798084499635914e3b8c6
openmp: Support allocate for C/C++ array section reductions

This adds allocate clause support for array section reductions.
Furthermore, it fixes one bug that would cause inscan reductions with
allocate to be rejected by C, and for now just ignores allocate for
inscan/task reductions, that will need slightly more work.

2020-11-13  Jakub Jelinek  <jakub@redhat.com>

gcc/
* omp-low.c (scan_sharing_clauses): For now remove for reduction
clauses with inscan or task modifiers decl from allocate_map.
(lower_private_allocate): Handle TYPE_P (new_var).
(lower_rec_input_clauses): Handle allocate clause for C/C++ array
reductions.
gcc/c/
* c-typeck.c (c_finish_omp_clauses): Don't clear
OMP_CLAUSE_REDUCTION_INSCAN unless reduction_seen == -2.
libgomp/
* testsuite/libgomp.c-c++-common/allocate-1.c (foo): Add tests
for array reductions.
(main): Adjust foo callers.
gcc/c/c-typeck.c
gcc/omp-low.c
libgomp/testsuite/libgomp.c-c++-common/allocate-1.c