diff options
author | cltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-06-03 14:25:12 +0000 |
---|---|---|
committer | cltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-06-03 14:25:12 +0000 |
commit | 2234363c4bfaec33b99a8344fd6c15dd1d1c86ea (patch) | |
tree | 23dd423fd8de79a39d2c78c414903727101e5b86 /gcc/cp/semantics.c | |
parent | 3e346f54bf009e9c2dbccb3654ba1e81c8bb8e26 (diff) |
2016-06-03 Chung-Lin Tang <cltang@codesourcery.com>
c/
* c-typeck.c (c_finish_omp_clauses): Mark OpenACC reduction
arguments as addressable when async clause exists.
cp/
* semantics.c (finish_omp_clauses): Mark OpenACC reduction
arguments as addressable when async clause exists.
fortran/
* trans-openmp.c (gfc_trans_omp_reduction_list): Add mark_addressable
bool parameter, set reduction clause DECLs as addressable when true.
(gfc_trans_omp_clauses): Pass clauses->async to
gfc_trans_omp_reduction_list, add comment describing OpenACC situation.
libgomp/
* testsuite/libgomp.oacc-fortran/reduction-8.f90: New testcase.
* testsuite/libgomp.oacc-c-c++-common/reduction-8.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237070 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 8e682c53795..536509127e4 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -5775,6 +5775,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) bool branch_seen = false; bool copyprivate_seen = false; bool ordered_seen = false; + bool oacc_async = false; bitmap_obstack_initialize (NULL); bitmap_initialize (&generic_head, &bitmap_default_obstack); @@ -5785,6 +5786,14 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) bitmap_initialize (&map_field_head, &bitmap_default_obstack); bitmap_initialize (&oacc_reduction_head, &bitmap_default_obstack); + if (ort & C_ORT_ACC) + for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c)) + if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_ASYNC) + { + oacc_async = true; + break; + } + for (pc = &clauses, c = clauses; c ; c = *pc) { bool remove = false; @@ -5828,6 +5837,8 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) t = n; goto check_dup_generic_t; } + if (oacc_async) + cxx_mark_addressable (t); goto check_dup_generic; case OMP_CLAUSE_COPYPRIVATE: copyprivate_seen = true; |