summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorJulian Brown <julian@codesourcery.com>2020-01-03 10:06:15 -0800
committerJulian Brown <julian@codesourcery.com>2020-01-28 06:00:29 -0800
commit278c3214b344ac7c5daf974196fbebc531bff058 (patch)
tree5fb64b46ceb10ceee9647519ec7b68320c82abc8 /libgomp
parent99b9f5b4067a8c5c5a706694b9a23516126984de (diff)
Don't allow mixed component and non-component accesses for OpenACC/Fortran
gcc/fortran/ * gfortran.h (gfc_symbol): Add comp_mark bitfield. * openmp.c (resolve_omp_clauses): Disallow mixed component and full-derived-type accesses to the same variable within a single directive. libgomp/ * testsuite/libgomp.oacc-fortran/deep-copy-2.f90: Remove test from here. * testsuite/libgomp.oacc-fortran/deep-copy-3.f90: Don't use mixed component/non-component variable refs in a single directive. * testsuite/libgomp.oacc-fortran/classtypes-1.f95: Likewise. gcc/testsuite/ * gfortran.dg/goacc/deep-copy-2.f90: Move test here (from libgomp testsuite). Make a compilation test, and expect rejection of mixed component/non-component accesses. * gfortran.dg/goacc/mapping-tests-1.f90: New test.
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog7
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/classtypes-1.f956
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/deep-copy-2.f9033
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/deep-copy-3.f904
4 files changed, 14 insertions, 36 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index b8fa7d457d8..9fa6bd1a5e4 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,10 @@
+2020-01-28 Julian Brown <julian@codesourcery.com>
+
+ * testsuite/libgomp.oacc-fortran/deep-copy-2.f90: Remove test from here.
+ * testsuite/libgomp.oacc-fortran/deep-copy-3.f90: Don't use mixed
+ component/non-component variable refs in a single directive.
+ * testsuite/libgomp.oacc-fortran/classtypes-1.f95: Likewise.
+
2020-01-24 Maciej W. Rozycki <macro@wdc.com>
* configure.ac: Handle `--with-toolexeclibdir='.
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/classtypes-1.f95 b/libgomp/testsuite/libgomp.oacc-fortran/classtypes-1.f95
index f16f42fc3af..c5f0ffffb02 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/classtypes-1.f95
+++ b/libgomp/testsuite/libgomp.oacc-fortran/classtypes-1.f95
@@ -31,7 +31,8 @@ program main
myvar%p%p(i) = -1.0
end do
-!$acc enter data copyin(myvar, myvar%p) create(myvar%p%p)
+!$acc enter data copyin(myvar)
+!$acc enter data copyin(myvar%p) create(myvar%p%p)
!$acc parallel loop present(myvar%p%p)
do i=1,100
@@ -39,7 +40,8 @@ program main
end do
!$acc end parallel loop
-!$acc exit data copyout(myvar%p%p) delete(myvar, myvar%p)
+!$acc exit data copyout(myvar%p%p) delete(myvar%p)
+!$acc exit data delete(myvar)
do i=1,100
if (myvar%p%p(i) .ne. i * 2) stop 1
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/deep-copy-2.f90 b/libgomp/testsuite/libgomp.oacc-fortran/deep-copy-2.f90
deleted file mode 100644
index 35936617b87..00000000000
--- a/libgomp/testsuite/libgomp.oacc-fortran/deep-copy-2.f90
+++ /dev/null
@@ -1,33 +0,0 @@
-! { dg-do run }
-
-! Test of attach/detach with "acc data", two clauses at once.
-
-program dtype
- implicit none
- integer, parameter :: n = 512
- type mytype
- integer, allocatable :: a(:)
- end type mytype
- integer i
-
- type(mytype) :: var
-
- allocate(var%a(1:n))
-
-!$acc data copy(var) copy(var%a)
-
-!$acc parallel loop
- do i = 1,n
- var%a(i) = i
- end do
-!$acc end parallel loop
-
-!$acc end data
-
- do i = 1,n
- if (i .ne. var%a(i)) stop 1
- end do
-
- deallocate(var%a)
-
-end program dtype
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/deep-copy-3.f90 b/libgomp/testsuite/libgomp.oacc-fortran/deep-copy-3.f90
index 667d944fecb..edb6b8d61a4 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/deep-copy-3.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/deep-copy-3.f90
@@ -16,12 +16,14 @@ program dtype
allocate(var%a(1:n))
allocate(var%b(1:n))
-!$acc parallel loop copy(var) copy(var%a(1:n)) copy(var%b(1:n))
+!$acc data copy(var)
+!$acc parallel loop copy(var%a(1:n)) copy(var%b(1:n))
do i = 1,n
var%a(i) = i
var%b(i) = i
end do
!$acc end parallel loop
+!$acc end data
do i = 1,n
if (i .ne. var%a(i)) stop 1