diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-05-04 08:34:06 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2006-05-04 08:34:06 +0200 |
commit | f6a5ffbfbf3387414b14426d4f41c4e6bc39b6c8 (patch) | |
tree | 53c788c929ca8d179572822a778ff283ee27923b /gcc/gimplify.c | |
parent | 76c5e6e079f5efe7ba978771e5234c303ca407c8 (diff) | |
download | gcc-f6a5ffbfbf3387414b14426d4f41c4e6bc39b6c8.zip gcc-f6a5ffbfbf3387414b14426d4f41c4e6bc39b6c8.tar.gz gcc-f6a5ffbfbf3387414b14426d4f41c4e6bc39b6c8.tar.bz2 |
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
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 17 |
1 files changed, 11 insertions, 6 deletions
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); } |