]> git.ipfire.org Git - thirdparty/gcc.git/commit
OpenMP 5.0: Allow multiple clauses mapping same variable
authorChung-Lin Tang <cltang@codesourcery.com>
Mon, 1 Feb 2021 11:16:47 +0000 (03:16 -0800)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 21 Jun 2022 13:11:32 +0000 (14:11 +0100)
commit4b1205e579733ad9b777052df019cbb83ce696c3
treec6a6ddae8717c440f953c2d47f286d8e22ebd5a4
parent353afd4ec8b7d72786b0a12ab78553acc3395c72
OpenMP 5.0: Allow multiple clauses mapping same variable

This is a merge of:
https://gcc.gnu.org/pipermail/gcc-patches/2020-December/562081.html

This patch now allows multiple clauses on the same construct to map
the same variable, which was not valid in OpenMP 4.5, but now allowed
in 5.0.

This may possibly reverted/updated when a final patch is approved
for mainline.

2021-02-01  Chung-Lin Tang  <cltang@codesourcery.com>

gcc/cp/ChangeLog:

* semantics.cc (finish_omp_clauses):  Adjust to allow duplicate
mapped variables for OpenMP.

gcc/ChangeLog:

* omp-low.cc (install_var_field): Add new 'tree key_expr = NULL_TREE'
default parameter. Set splay-tree lookup key to key_expr instead of
var if key_expr is non-NULL. Adjust call to install_parm_decl.
Update comments.
(scan_sharing_clauses): Use clause tree expression as splay-tree key
for map/to/from and OpenACC firstprivate cases when installing the
variable field into the send/receive record type.
(maybe_lookup_field_in_outer_ctx): Add code to search through
construct clauses instead of entirely based on splay-tree lookup.
(lower_oacc_reductions): Adjust to find map-clause of reduction
variable, then create receiver-ref.
(lower_omp_target): Adjust to lookup var field using clause expression.

gcc/testsuite/ChangeLog:

* c-c++-common/gomp/clauses-2.c: Adjust testcase.
gcc/ChangeLog.omp
gcc/cp/ChangeLog.omp
gcc/cp/semantics.cc
gcc/omp-low.cc
gcc/testsuite/ChangeLog.omp
gcc/testsuite/c-c++-common/gomp/clauses-2.c