From f6a5ffbfbf3387414b14426d4f41c4e6bc39b6c8 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 4 May 2006 08:34:06 +0200 Subject: re PR middle-end/27388 (omp_is_private issues) PR middle-end/27388 * gimplify.c (omp_is_private): If var is shared in some outer context, return false instead of true. Stop searching on parallel context boundary. * gcc.dg/gomp/pr27388-1.c: New test. * gcc.dg/gomp/pr27388-2.c: New test. * gcc.dg/gomp/pr27388-3.c: New test. From-SVN: r113514 --- gcc/gimplify.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'gcc/gimplify.c') diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 91b8881..000f610 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -4443,17 +4443,22 @@ omp_is_private (struct gimplify_omp_ctx *ctx, tree decl) if (n->value & GOVD_SHARED) { if (ctx == gimplify_omp_ctxp) - error ("iteration variable %qs should be private", - IDENTIFIER_POINTER (DECL_NAME (decl))); - n->value = GOVD_PRIVATE; + { + error ("iteration variable %qs should be private", + IDENTIFIER_POINTER (DECL_NAME (decl))); + n->value = GOVD_PRIVATE; + return true; + } + else + return false; } return true; } - if (ctx->outer_context) - return omp_is_private (ctx->outer_context, decl); - else if (ctx->is_parallel) + if (ctx->is_parallel) return false; + else if (ctx->outer_context) + return omp_is_private (ctx->outer_context, decl); else return !is_global_var (decl); } -- cgit v1.1