diff options
author | Tobias Burnus <tburnus@baylibre.com> | 2025-02-17 22:52:34 +0100 |
---|---|---|
committer | Tobias Burnus <tburnus@baylibre.com> | 2025-02-17 22:52:34 +0100 |
commit | 8268c8256dd430174e89142be9ee77b036d6310d (patch) | |
tree | 6c365f6cd778302bf7254f68857ad04b5fda580f /gcc/fortran/gfortran.h | |
parent | 565d4e755498ad2b5ed55e368ef61eb9511cda3a (diff) | |
download | gcc-8268c8256dd430174e89142be9ee77b036d6310d.zip gcc-8268c8256dd430174e89142be9ee77b036d6310d.tar.gz gcc-8268c8256dd430174e89142be9ee77b036d6310d.tar.bz2 |
OpenMP/Fortran: extend 'adjust_args' clause, fixes for it and declare variant [PR115271]
On the extension side, it implements OpenMP 6.0's numeric values/ranges for
the adjust_args arguments, including 'omp_num_args'. And it adds parser
support for need_device_addr. It also implements the post-OpenMP-6.0
clarification of OpenMP spec Issue #4443 regarding type(c_ptr) with
dimension being invalid for need_device_ptr.
To be done: Adding full support for need_device_addr (optional, array
descriptor, ...).
On the invalid side, it removed a bogus c_ptr check that went through
all adjust_args without checking for need_device_ptr and the current scope.
And it finally also processes 'declare variant' in an INTERFACE block,
which is part of PR115271, but it does not handle .mod file yet - the
main issue tracked in that PR.
PR fortran/115271
gcc/fortran/ChangeLog:
* gfortran.h (gfc_omp_namelist): Change need_device_ptr to adj_args
union and add more flags.
* openmp.cc (gfc_match_omp_declare_variant,
gfc_resolve_omp_declare): For adjust_args, handle need_device_addr
and numeric values/ranges besides dummy argument names.
(resolve_omp_dispatch): Remove bogus a adjust_args check.
* trans-decl.cc (gfc_handle_omp_declare_variant): New.
(gfc_generate_module_vars, gfc_generate_function_code): Call it.
* trans-openmp.cc (gfc_trans_omp_declare_variant): Handle numeric
values/ranges besides dummy argument names.
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/adjust-args-1.f90: Update dg-.* expectations.
* gfortran.dg/gomp/adjust-args-2.f90: Likewise.
* gfortran.dg/gomp/adjust-args-2a.f90: Likewise.
* gfortran.dg/gomp/adjust-args-3.f90: Likewise.
* gfortran.dg/gomp/adjust-args-4.f90: Remove array from c_ptr.
* gfortran.dg/gomp/adjust-args-5.f90: Likewise.
* gfortran.dg/gomp/adjust-args-11.f90: Likewise. Add check that
INTERFACE is now handled in subroutines and in modules.
* gfortran.dg/gomp/adjust-args-13.f90: New test.
* gfortran.dg/gomp/adjust-args-14.f90: New test.
* gfortran.dg/gomp/adjust-args-15.f90: New test.
* gfortran.dg/gomp/declare-variant-21.f90: New test.
Diffstat (limited to 'gcc/fortran/gfortran.h')
-rw-r--r-- | gcc/fortran/gfortran.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 5fe1276..557c5c7 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1412,7 +1412,15 @@ typedef struct gfc_omp_namelist bool target; bool targetsync; } init; - bool need_device_ptr; + struct + { + bool need_ptr:1; + bool need_addr:1; + bool range_start:1; + bool omp_num_args_plus:1; + bool omp_num_args_minus:1; + bool error_p:1; + } adj_args; } u; union { |