diff options
author | Tobias Burnus <tburnus@baylibre.com> | 2025-07-12 07:18:06 +0200 |
---|---|---|
committer | Tobias Burnus <tburnus@baylibre.com> | 2025-07-12 07:18:06 +0200 |
commit | 451b6dbf47595922518b96728677d1fafa11e2ad (patch) | |
tree | 20aab9e822230f89c405c715025dc4eac8c522ca /gcc/ada/gcc-interface/ada.h | |
parent | 2a73ddc6e3285ce7d57f66710de533c70eb82788 (diff) | |
download | gcc-451b6dbf47595922518b96728677d1fafa11e2ad.zip gcc-451b6dbf47595922518b96728677d1fafa11e2ad.tar.gz gcc-451b6dbf47595922518b96728677d1fafa11e2ad.tar.bz2 |
Fortran/OpenACC: Permit PARAMETER as 'var' in clauses (+ ignore)
It turned out that other compilers permit (require?) named constants
to appear in clauses - and programs actually use this. OpenACC 3.4
added therefore the following:
In this spec, a _var_ (in italics) is one of the following:
...
* a named constant in Fortran.
plus
If during an optimization phase _var_ is removed by the compiler,
appearances of var in data clauses are ignored.
Thus, all errors related to PARAMETER are now downgraded, most
to a -Wsurprising warning, but for 'acc declare device_resident'
(which kind of makes sense), no warning is printed.
In trans-openmp.cc, those are ignored, unless I missed some code
path. (If so, I hope the middle end removes them; but before
removing them for the covered cases, the program just compiled &
linked fine.)
Note that 'ignore PARAMETER inside clauses' in trans-openmp.cc
would in principle also apply to expressions ('if (var)') but
those should be evaluated during 'resolve.cc' + 'openmp.cc' to
their (numeric, logical, string) value such that there should
be no issue.
gcc/fortran/ChangeLog:
* invoke.texi (-Wsurprising): Note about OpenACC warning
related to PARAMATER.
* openmp.cc (resolve_omp_clauses, gfc_resolve_oacc_declare):
Accept PARAMETER for OpenACC but add surprising warning.
* trans-openmp.cc (gfc_trans_omp_variable_list,
gfc_trans_omp_clauses): Ignore PARAMETER inside clauses.
gcc/testsuite/ChangeLog:
* gfortran.dg/goacc/parameter.f95: Add -Wsurprising flag
and update expected diagnostic.
* gfortran.dg/goacc/parameter-3.f90: New test.
* gfortran.dg/goacc/parameter-4.f90: New test.
Diffstat (limited to 'gcc/ada/gcc-interface/ada.h')
0 files changed, 0 insertions, 0 deletions