aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2018-01-25 10:25:14 +0000
committerTom de Vries <vries@gcc.gnu.org>2018-01-25 10:25:14 +0000
commite77a1236a74de93773633cd39748bb8f79f0ea82 (patch)
tree81f0be418f43f5773213ef39db7b8def697ae24c
parent8819c9199a6f6d4ad4a3eb83eef6e91122482c33 (diff)
downloadgcc-e77a1236a74de93773633cd39748bb8f79f0ea82.zip
gcc-e77a1236a74de93773633cd39748bb8f79f0ea82.tar.gz
gcc-e77a1236a74de93773633cd39748bb8f79f0ea82.tar.bz2
[nvptx, PR84028] Add exit insn after noreturn call for neutered workers
2018-01-25 Tom de Vries <tom@codesourcery.com> PR target/84028 * config/nvptx/nvptx.c (nvptx_single): Add exit insn after noreturn call for neutered workers. * testsuite/libgomp.oacc-fortran/pr84028.f90: New test. From-SVN: r257046
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/nvptx/nvptx.c4
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/pr84028.f9025
4 files changed, 38 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c46bc6d..69cbcc6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-01-25 Tom de Vries <tom@codesourcery.com>
+
+ PR target/84028
+ * config/nvptx/nvptx.c (nvptx_single): Add exit insn after noreturn call
+ for neutered workers.
+
2018-01-24 Joseph Myers <joseph@codesourcery.com>
PR target/68467
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index d848412..a6f4443 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -4065,8 +4065,8 @@ nvptx_single (unsigned mask, basic_block from, basic_block to)
else
{
rtx_insn *label_insn = emit_label_after (label, tail);
- if (mode == GOMP_DIM_VECTOR && CALL_P (tail)
- && find_reg_note (tail, REG_NORETURN, NULL))
+ if ((mode == GOMP_DIM_VECTOR || mode == GOMP_DIM_WORKER)
+ && CALL_P (tail) && find_reg_note (tail, REG_NORETURN, NULL))
emit_insn_after (gen_exit (), label_insn);
}
}
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index a064863..a7bbceb 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-25 Tom de Vries <tom@codesourcery.com>
+
+ PR target/84028
+ * testsuite/libgomp.oacc-fortran/pr84028.f90: New test.
+
2018-01-24 Tom de Vries <tom@codesourcery.com>
PR target/83589
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/pr84028.f90 b/libgomp/testsuite/libgomp.oacc-fortran/pr84028.f90
new file mode 100644
index 0000000..ed6e326
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/pr84028.f90
@@ -0,0 +1,25 @@
+! { dg-do run }
+
+program foo
+ integer :: a(3,3,3), ll, lll
+
+ a = 1
+
+ !$acc parallel num_gangs(1) num_workers(2)
+
+ if (any(a(1:3,1:3,1:3).ne.1)) call abort
+
+ do ll=1,3
+
+ !$acc loop vector
+ do lll=1,3
+ a(1,ll,lll) = 2
+ enddo
+
+ enddo
+
+ if (a(1,1,1).ne.2) call abort
+
+ !$acc end parallel
+
+end program foo