aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2019-01-15 10:11:16 +0000
committerTom de Vries <vries@gcc.gnu.org>2019-01-15 10:11:16 +0000
commitd41d952c9bbdffe6fd2badc9c4f2c18d241ce412 (patch)
treefdceb1ac2aa40eab19d344b5ab5e33831dd367bf
parent4882e5badaad9a0174a8ace1d71448e0f824bdf1 (diff)
downloadgcc-d41d952c9bbdffe6fd2badc9c4f2c18d241ce412.zip
gcc-d41d952c9bbdffe6fd2badc9c4f2c18d241ce412.tar.gz
gcc-d41d952c9bbdffe6fd2badc9c4f2c18d241ce412.tar.bz2
[nvptx] Handle assignment to gang-level reduction variable
2019-01-15 Tom de Vries <tdevries@suse.de> PR target/80547 * config/nvptx/nvptx.c (nvptx_goacc_reduction_init): Handle lhs == NULL_TREE for gang-level reduction. * testsuite/libgomp.oacc-c-c++-common/gang-reduction-var-assignment.c: New test. From-SVN: r267934
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/nvptx/nvptx.c3
-rw-r--r--libgomp/ChangeLog6
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/gang-reduction-var-assignment.c16
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 576541e..e451509 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-15 Tom de Vries <tdevries@suse.de>
+
+ PR target/80547
+ * config/nvptx/nvptx.c (nvptx_goacc_reduction_init): Handle
+ lhs == NULL_TREE for gang-level reduction.
+
2019-01-15 Richard Biener <rguenther@suse.de>
Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 03c0f82..23459e1c 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -6242,7 +6242,8 @@ nvptx_goacc_reduction_init (gcall *call, offload_attrs *oa)
init = var;
}
- gimplify_assign (lhs, init, &seq);
+ if (lhs != NULL_TREE)
+ gimplify_assign (lhs, init, &seq);
}
pop_gimplify_context (NULL);
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index c279edf..becfc70 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-15 Tom de Vries <tdevries@suse.de>
+
+ PR target/80547
+ * testsuite/libgomp.oacc-c-c++-common/gang-reduction-var-assignment.c:
+ New test.
+
2019-01-12 Tom de Vries <tdevries@suse.de>
* testsuite/libgomp.oacc-c-c++-common/pr85486-2.c: New test.
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/gang-reduction-var-assignment.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/gang-reduction-var-assignment.c
new file mode 100644
index 0000000..05f58a4
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/gang-reduction-var-assignment.c
@@ -0,0 +1,16 @@
+/* { dg-xfail-run-if "PR88852" { openacc_host_selected } } */
+
+int
+main (void)
+{
+ int x = 123;
+
+#pragma acc parallel num_gangs(1) reduction (+: x)
+ {
+ x = 23;
+ }
+ if (x != 146)
+ __builtin_abort();
+
+ return 0;
+}