2016-08-29 Cesar Philippidis <cesar@codesourcery.com>
PR fortran/72715
gcc/fortran/
* openmp.c (resolve_oacc_nested_loops): Error on do concurrent loops.
gcc/testsuite/
* gfortran.dg/goacc/loop-3-2.f95: Error on do concurrent loops.
* gfortran.dg/goacc/loop-3.f95: Likewise.
* gfortran.dg/goacc/pr72715.f90: New test.
@@ -4998,7 +4998,13 @@ resolve_oacc_nested_loops (gfc_code *code, gfc_code* do_code, int collapse,
"at %L", &do_code->loc);
break;
}
- gcc_assert (do_code->op == EXEC_DO || do_code->op == EXEC_DO_CONCURRENT);
+ if (do_code->op == EXEC_DO_CONCURRENT)
+ {
+ gfc_error ("!$ACC LOOP cannot be a DO CONCURRENT loop at %L",
+ &do_code->loc);
+ break;
+ }
+ gcc_assert (do_code->op == EXEC_DO);
if (do_code->ext.iterator->var->ts.type != BT_INTEGER)
gfc_error ("!$ACC LOOP iteration variable must be of type integer at %L",
&do_code->loc);
@@ -27,9 +27,9 @@ subroutine test1
!$acc end parallel
!$acc end loop ! { dg-error "Unexpected" }
- ! OpenACC supports Fortran 2008 do concurrent statement
+ ! OpenACC does not support Fortran 2008 do concurrent statement
!$acc loop
- do concurrent (i = 1:5)
+ do concurrent (i = 1:5) ! { dg-error "ACC LOOP cannot be a DO CONCURRENT loop" }
end do
!$acc loop
@@ -24,9 +24,9 @@ subroutine test1
!$acc end parallel
!$acc end loop ! { dg-error "Unexpected" }
- ! OpenACC supports Fortran 2008 do concurrent statement
+ ! OpenACC does not support Fortran 2008 do concurrent statement
!$acc loop
- do concurrent (i = 1:5)
+ do concurrent (i = 1:5) ! { dg-error "ACC LOOP cannot be a DO CONCURRENT loop" }
end do
!$acc loop
new file mode 100644
@@ -0,0 +1,6 @@
+program p
+ integer :: i
+ !$acc loop
+ do concurrent (i=1:3) ! { dg-error "ACC LOOP cannot be a DO CONCURRENT loop" }
+ end do
+end program p