This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, openmp/openacc] Allow Fortran parameters in map/copy.

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 be nicer.

Any suggestions?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]