diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2020-06-16 20:18:31 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2020-06-16 20:23:58 +0200 |
commit | 12df77ab6df4b91d4770240bcc4ab443e4bb18b9 (patch) | |
tree | bc813b527747e25caf6648269c40345834fe047f /gcc/fortran/openmp.c | |
parent | 244ed2adaa3d349d381ca6ce090c2fa69b6e8d8b (diff) | |
download | gcc-12df77ab6df4b91d4770240bcc4ab443e4bb18b9.zip gcc-12df77ab6df4b91d4770240bcc4ab443e4bb18b9.tar.gz gcc-12df77ab6df4b91d4770240bcc4ab443e4bb18b9.tar.bz2 |
OpenACC/Fortran: permit 'routine' inside PURE
gcc/fortran/ChangeLog
* parse.c (decode_oacc_directive): Permit 'acc routine' also
inside pure procedures.
* openmp.c (gfc_match_oacc_routine): Inside pure procedures
do not permit gang, worker or vector clauses.
libgomp/ChangeLog:
* testsuite/libgomp.oacc-fortran/routine-10.f90: New test.
gcc/testsuite/ChangeLog:
* gfortran.dg/goacc/pure-elemental-procedures-2.f90: New test.
Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r-- | gcc/fortran/openmp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index b246308..94522d1 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -2525,6 +2525,14 @@ gfc_match_oacc_routine (void) /* Something has gone wrong, possibly a syntax error. */ goto cleanup; + if (gfc_pure (NULL) && c && (c->gang || c->worker || c->vector)) + { + gfc_error ("!$ACC ROUTINE with GANG, WORKER, or VECTOR clause is not " + "permitted in PURE procedure at %C"); + goto cleanup; + } + + if (n) n->clauses = c; else if (gfc_current_ns->oacc_routine) |