This is the mail archive of the
mailing list for the GCC project.
Re: [patch, openmp/openacc] Allow Fortran parameters in map/copy.
- From: Andrew Stubbs <ams at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Fortran List <fortran at gcc dot gnu dot org>
- Date: Fri, 5 Jul 2019 13:10:00 +0100
- Subject: Re: [patch, openmp/openacc] Allow Fortran parameters in map/copy.
- References: <email@example.com> <20190705114951.GL815@tucnak>
On 05/07/2019 12:49, Jakub Jelinek wrote:
On Fri, Jul 05, 2019 at 12:31:17PM +0100, Andrew Stubbs wrote:
This patch allows Fortran "parameter" named constants to be named in OpenMP
map and OpenACC copy directives.
Right now, the compiler just says something like:
!$omp target data map(tofrom:N,x)
Error: Object 'n' is not a variable at (1)
This is technically correct, but is surprising to the user and AFAICT the
OpenMP/OpenACC documents don't say you can't name parameters, so I'd like it
to be allowed.
I don't think you can do it in OpenMP, I can discuss in the language
committee, but the definition of variable is:
"A named data storage block, for which the value can be defined and redefined during
the execution of a program."
so I don't believe Fortran parameters are OpenMP variables.
Scalar Fortran parameters don't even have any data storage block associated
with them at all.
Agreed, they are not variables (nor variable), and copying them about is
entirely pointless (although, if you simply remove the error check GCC
will happily create storage for 'N' and do the copies).
And yet, this issue has generated a support request from a blocked
customer, and I'd like to improve their experience.
I could generate a warning, or add a note to the error message, but in
the interests of portability I thought just doing the right thing would