Fortran: fix checks for STAT= and ERRMSG= arguments of SYNC ALL/SYNC IMAGES
authorHarald Anlauf <anlauf@gmx.de>
Sun, 15 Aug 2021 18:13:11 +0000 (20:13 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Sun, 15 Aug 2021 18:13:11 +0000 (20:13 +0200)
commitbbf19f9c20515da9fcd23f08c8139427374e8d77
treebef0ccd8bb64afb5e6d7d781edd6829dcf9f7df3
parent34ce7f7a9a64dd69dd6a77dfd4a77406c3c71014
Fortran: fix checks for STAT= and ERRMSG= arguments of SYNC ALL/SYNC IMAGES

gcc/fortran/ChangeLog:

PR fortran/99351
* match.c (sync_statement): Replace %v code by %e in gfc_match to
allow for function references as STAT and ERRMSG arguments.
* resolve.c (resolve_sync): Adjust checks of STAT= and ERRMSG= to
being definable arguments.  Function references with a data
pointer result are accepted.
* trans-stmt.c (gfc_trans_sync): Adjust assertion.

gcc/testsuite/ChangeLog:

PR fortran/99351
* gfortran.dg/coarray_sync.f90: New test.
* gfortran.dg/coarray_3.f90: Adjust error messages.
gcc/fortran/match.c
gcc/fortran/resolve.c
gcc/fortran/trans-stmt.c
gcc/testsuite/gfortran.dg/coarray_3.f90
gcc/testsuite/gfortran.dg/coarray_sync.f90 [new file with mode: 0644]