This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Fix handling of shared(global_var) on omp parallel inside target region (PR middle-end/62092)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 15 Aug 2014 09:45:38 +0200
- Subject: [committed] Fix handling of shared(global_var) on omp parallel inside target region (PR middle-end/62092)
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
We need OMP_CLAUSE_SHARED even for global vars if they are mapped
in an outer target region, because then the parallel region can't
access the global, but has to go through the mapping.
Testcase already in the testsuite (but failed only with non-shared
address space obviously).
Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk
and 4.9.
2014-08-15 Jakub Jelinek <jakub@redhat.com>
PR middle-end/62092
* gimplify.c (gimplify_adjust_omp_clauses_1): Don't remove
OMP_CLAUSE_SHARED for global vars if the global var is mentioned
in OMP_CLAUSE_MAP in some outer target region.
--- gcc/gimplify.c.jj 2014-08-12 15:43:07.000000000 +0200
+++ gcc/gimplify.c 2014-08-14 13:39:22.263181286 +0200
@@ -6308,7 +6308,7 @@ gimplify_adjust_omp_clauses_1 (splay_tre
= splay_tree_lookup (ctx->variables, (splay_tree_key) decl);
if (on && (on->value & (GOVD_FIRSTPRIVATE | GOVD_LASTPRIVATE
| GOVD_PRIVATE | GOVD_REDUCTION
- | GOVD_LINEAR)) != 0)
+ | GOVD_LINEAR | GOVD_MAP)) != 0)
break;
ctx = ctx->outer_context;
}
Jakub