diff options
author | Chung-Lin Tang <cltang@codesourcery.com> | 2016-06-03 14:25:12 +0000 |
---|---|---|
committer | Chung-Lin Tang <cltang@gcc.gnu.org> | 2016-06-03 14:25:12 +0000 |
commit | b605f6639c14383eb274e90c4fa6f995af514fbc (patch) | |
tree | 23dd423fd8de79a39d2c78c414903727101e5b86 /gcc/c | |
parent | 36b85e432865a312aa8edc8978e38266e8a0f14c (diff) | |
download | gcc-b605f6639c14383eb274e90c4fa6f995af514fbc.zip gcc-b605f6639c14383eb274e90c4fa6f995af514fbc.tar.gz gcc-b605f6639c14383eb274e90c4fa6f995af514fbc.tar.bz2 |
c-typeck.c (c_finish_omp_clauses): Mark OpenACC reduction arguments as addressable when async clause exists.
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.
From-SVN: r237070
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index d2a8947..1262c82 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2016-06-03 Chung-Lin Tang <cltang@codesourcery.com> + + * c-typeck.c (c_finish_omp_clauses): Mark OpenACC reduction + arguments as addressable when async clause exists. + 2016-05-30 Jakub Jelinek <jakub@redhat.com> PR c++/71349 diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 1520c20..0ff28f2 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -12529,6 +12529,7 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort) tree *nowait_clause = NULL; bool ordered_seen = false; tree schedule_clause = NULL_TREE; + bool oacc_async = false; bitmap_obstack_initialize (NULL); bitmap_initialize (&generic_head, &bitmap_default_obstack); @@ -12539,6 +12540,14 @@ c_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; @@ -12575,6 +12584,8 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort) remove = true; break; } + if (oacc_async) + c_mark_addressable (t); type = TREE_TYPE (t); if (TREE_CODE (t) == MEM_REF) type = TREE_TYPE (type); |