aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-06-27 21:45:14 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-06-27 21:45:14 +0200
commitca2b131143a3195e603493aadd0a0b4a18ad737f (patch)
tree8a25e70be23ac06cb0b9b579a0923434c229535c /gcc
parentb357f682db35f4431e3011e7486a0ac865686e3e (diff)
downloadgcc-ca2b131143a3195e603493aadd0a0b4a18ad737f.zip
gcc-ca2b131143a3195e603493aadd0a0b4a18ad737f.tar.gz
gcc-ca2b131143a3195e603493aadd0a0b4a18ad737f.tar.bz2
gimplify.c (omp_is_private): Don't return true if decl is not already private on #pragma omp for or #pragma...
* 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. From-SVN: r137199
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/gimplify.c7
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr27388-3.c2
4 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 38ce1cf..ef3bf5f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
2008-06-27 Jakub Jelinek <jakub@redhat.com>
+ * gimplify.c (omp_is_private): Don't return true if decl
+ is not already private on #pragma omp for or #pragma omp parallel for.
+
PR debug/36617
* tree-cfg.c (struct move_stmt_d): Replace block field with
orig_block and new_block fields.
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 799ccbe..c3af34b 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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 086345b..4ede6da 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2008-06-27 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/gomp/pr27388-3.c: Adjust dg-final.
+
2008-06-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/36400
diff --git a/gcc/testsuite/gcc.dg/gomp/pr27388-3.c b/gcc/testsuite/gcc.dg/gomp/pr27388-3.c
index a6f4647..2cddb23 100644
--- a/gcc/testsuite/gcc.dg/gomp/pr27388-3.c
+++ b/gcc/testsuite/gcc.dg/gomp/pr27388-3.c
@@ -19,5 +19,5 @@ foo (void)
}
}
-/* { dg-final { scan-tree-dump-times "omp for\[^\\n\]*private" 0 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "omp for\[^\\n\]*private" 2 "omplower" } } */
/* { dg-final { cleanup-tree-dump "omplower" } } */