summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-26 10:13:34 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2017-05-26 10:13:34 +0000
commit79c188a5d3679be8272e1cf96fbfbaf4550f3b56 (patch)
treeecff24a28117066a76291d9cd6c792bd060f2e6d /libgomp
parentdd4c9153626c8f759c7c98aa37c7bae3038a6506 (diff)
Backported from mainline
2017-05-22 Jakub Jelinek <jakub@redhat.com> PR middle-end/80809 * gimplify.c (omp_add_variable): For GOVD_DEBUG_PRIVATE use GOVD_SHARED rather than GOVD_PRIVATE with it. (gimplify_adjust_omp_clauses_1, gimplify_adjust_omp_clauses): Expect GOVD_SHARED rather than GOVD_PRIVATE with GOVD_DEBUG_PRIVATE. * testsuite/libgomp.c/pr80809-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@248487 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog3
-rw-r--r--libgomp/testsuite/libgomp.c/pr80809-1.c29
2 files changed, 32 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 8e3635bb6d98..9a2d4e5a43e4 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -2,6 +2,9 @@
Backported from mainline
2017-05-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/80809
+ * testsuite/libgomp.c/pr80809-1.c: New test.
PR middle-end/80853
* testsuite/libgomp.c/pr80853.c: New test.
diff --git a/libgomp/testsuite/libgomp.c/pr80809-1.c b/libgomp/testsuite/libgomp.c/pr80809-1.c
new file mode 100644
index 000000000000..07abb499ecfa
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr80809-1.c
@@ -0,0 +1,29 @@
+/* PR middle-end/80809 */
+/* { dg-do run } */
+
+__attribute__((noinline, noclone)) void
+foo (int x)
+{
+ int i, j, v[x], *w[16];
+ for (i = 0; i < x; i++)
+ v[i] = i;
+#pragma omp parallel
+#pragma omp single
+ for (i = 0; i < 16; i++)
+ /* Make sure v is implicitly determined shared in task, because it
+ is shared on the parallel. */
+#pragma omp task private (j)
+ w[i] = v;
+ for (i = 0; i < 16; i++)
+ if (w[i] != v)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ foo (4);
+ foo (27);
+ foo (196);
+ return 0;
+}