From: Julian Brown Date: Fri, 20 Sep 2019 20:53:10 +0000 (-0700) Subject: Handle references in OpenACC "private" clauses X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebe33b92d3048123714185338d2657419d41f125;p=thirdparty%2Fgcc.git Handle references in OpenACC "private" clauses gcc/ * gimplify.cc (localize_reductions): Rewrite references for OMP_CLAUSE_PRIVATE also. --- diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp index fd91f876cc85..84ebebbe7b60 100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,3 +1,8 @@ +2019-09-20 Julian Brown + + * gimplify.cc (localize_reductions): Rewrite references for + OMP_CLAUSE_PRIVATE also. + 2019-09-17 Tobias Burnus * gimplify.cc (gomp_oacc_needs_data_present): Remove unused variable. diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc index 76564c69249e..576633ecf3d8 100644 --- a/gcc/gimplify.cc +++ b/gcc/gimplify.cc @@ -12610,6 +12610,21 @@ localize_reductions (tree clauses, tree body) OMP_CLAUSE_REDUCTION_PRIVATE_DECL (c) = new_var; } + else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_PRIVATE) + { + var = OMP_CLAUSE_DECL (c); + + if (!lang_hooks.decls.omp_privatize_by_reference (var)) + continue; + + type = TREE_TYPE (TREE_TYPE (var)); + new_var = create_tmp_var (type, IDENTIFIER_POINTER (DECL_NAME (var))); + + pr.ref_var = var; + pr.local_var = new_var; + + walk_tree (&body, localize_reductions_r, &pr, NULL); + } }