summaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-27 19:45:14 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-27 19:45:14 +0000
commit919041c78aa12eb6523e5616249fa20a3daae39a (patch)
tree8a25e70be23ac06cb0b9b579a0923434c229535c /gcc/gimplify.c
parent1d22f5410404086ab5a422b394c9bcf00b64973a (diff)
downloadgcc-919041c78aa12eb6523e5616249fa20a3daae39a.tar.gz
* gimplify.c (omp_is_private): Don't return true if decl
is not already private on #pragma omp for or #pragma omp parallel for. * gcc.dg/gomp/pr27388-3.c: Adjust dg-final. * testsuite/libgomp.c/loop-10.c: New test. * libgomp.c/loop-3.c (main): Add lastprivate clause. * libgomp.c++/loop-6.C (main): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137199 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 799ccbee52c..c3af34bf27e 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -5060,15 +5060,16 @@ omp_is_private (struct gimplify_omp_ctx *ctx, tree decl)
error ("iteration variable %qs should not be reduction",
IDENTIFIER_POINTER (DECL_NAME (decl)));
}
- return true;
+ return (ctx == gimplify_omp_ctxp
+ || (ctx->region_type == ORT_COMBINED_PARALLEL
+ && gimplify_omp_ctxp->outer_context == ctx));
}
if (ctx->region_type != ORT_WORKSHARE)
return false;
else if (ctx->outer_context)
return omp_is_private (ctx->outer_context, decl);
- else
- return !is_global_var (decl);
+ return false;
}
/* Return true if DECL is private within a parallel region