+2019-12-20 Tobias Burnus <tobias@codesourcery.com>
+
+ * openmp.c (resolve_omp_clauses): Move is-coindexed check from here ...
+ (gfc_match_omp_variable_list): ... to here.
+
2019-12-19 Julian Brown <julian@codesourcery.com>
* openmp.c (resolve_oacc_data_clauses): Don't disallow allocatable
default:
break;
}
+ if (gfc_is_coindexed (expr))
+ {
+ gfc_error ("List item shall not be coindexed at %C");
+ goto cleanup;
+ }
}
gfc_set_sym_referenced (sym);
p = gfc_get_omp_namelist ();
gfc_error ("%qs in %s clause at %L is not a proper "
"array section", n->sym->name, name,
&n->where);
- else if (gfc_is_coindexed (n->expr))
- gfc_error ("Entry shall not be coindexed in %s "
- "clause at %L", name, &n->where);
else
{
int i;
+2019-12-20 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.dg/goacc/coindexed-1.f90: New.
+
2019-12-20 Tobias Burnus <tobias@codesourcery.com>
* gfortran.dg/goacc/data-clauses.f95: Remove now
--- /dev/null
+! { dg-do compile }
+! { dg-additional-options "-fcoarray=single" }
+!
+subroutine check_coindexed()
+implicit none
+type t
+ integer :: i
+end type t
+type t2
+ integer, allocatable :: i[:]
+ type(t), allocatable :: x[:]
+end type t2
+type(t), allocatable :: A(:)[:], B(:)[:]
+type(t) :: D(1)[*], E[*]
+type(t2) :: C
+save :: D, E
+
+! Coarrays are fine if they are local/not coindexed:
+
+!$acc enter data copyin(D(1)%i)
+!$acc enter data copyin(A(1))
+!$acc enter data copyin(B(1)%i)
+!$acc enter data copyin(C%i)
+!$acc enter data copyin(C%x%i)
+!$acc enter data copyin(C%i)
+!$acc enter data copyin(C%x%i)
+
+! Does not like the '[' after the identifier:
+!$acc enter data copyin(E[2]) ! { dg-error "Syntax error in OpenMP variable list" }
+
+!$acc enter data copyin(D(1)[2]%i) ! { dg-error "List item shall not be coindexed" }
+!$acc enter data copyin(A(1)[4]) ! { dg-error "List item shall not be coindexed" }
+!$acc enter data copyin(B(1)[4]%i) ! { dg-error "List item shall not be coindexed" }
+!$acc enter data copyin(C%i[2]) ! { dg-error "List item shall not be coindexed" }
+!$acc enter data copyin(C%x[4]%i) ! { dg-error "List item shall not be coindexed" }
+
+end