This is a respin of my patchset implementing both the `dispatch` construct and the `adjust_args` clause to the `declare variant` directive. The original submission can be found there: https://gcc.gnu.org/pipermail/gcc-patches/2024-May/652819.html.
Beside being rebased, this new iteration has the following changes: * Add a commit to fix an incorrect warning with `gfc_error`; * Add a testcase (xfailed due to PR/115271) to ensure that `adjust_args` works across TUs in Fortran; * Rule out `c_funptr` for `need_device_ptr`; * Fix some warnings turned into errors during bootstrapping. Paul-Antoine Arras (8): Fix warnings for tree formats in gfc_error OpenMP: dispatch + adjust_args tree data structures and front-end interfaces OpenMP: middle-end support for dispatch + adjust_args OpenMP: C front-end support for dispatch + adjust_args OpenMP: C++ front-end support for dispatch + adjust_args OpenMP: common C/C++ testcases for dispatch + adjust_args OpenMP: Fortran front-end support for dispatch + adjust_args OpenMP: update documentation for dispatch and adjust_args gcc/builtin-types.def | 1 + gcc/c-family/c-attribs.cc | 2 + gcc/c-family/c-format.cc | 4 + gcc/c-family/c-omp.cc | 4 +- gcc/c-family/c-pragma.cc | 1 + gcc/c-family/c-pragma.h | 3 + gcc/c/c-parser.cc | 496 ++++++++++++-- gcc/c/c-typeck.cc | 2 + gcc/cp/decl.cc | 33 + gcc/cp/parser.cc | 612 ++++++++++++++++-- gcc/cp/pt.cc | 3 + gcc/cp/semantics.cc | 20 + gcc/fortran/dump-parse-tree.cc | 17 + gcc/fortran/frontend-passes.cc | 2 + gcc/fortran/gfortran.h | 11 +- gcc/fortran/match.h | 1 + gcc/fortran/openmp.cc | 201 +++++- gcc/fortran/parse.cc | 39 +- gcc/fortran/resolve.cc | 2 + gcc/fortran/st.cc | 1 + gcc/fortran/trans-decl.cc | 9 +- gcc/fortran/trans-openmp.cc | 161 +++++ gcc/fortran/trans.cc | 1 + gcc/fortran/types.def | 1 + gcc/gimple-low.cc | 1 + gcc/gimple-pretty-print.cc | 33 + gcc/gimple-walk.cc | 1 + gcc/gimple.cc | 20 + gcc/gimple.def | 5 + gcc/gimple.h | 33 +- gcc/gimplify.cc | 412 +++++++++++- gcc/gimplify.h | 2 + gcc/omp-builtins.def | 6 + gcc/omp-expand.cc | 18 + gcc/omp-general.cc | 16 +- gcc/omp-low.cc | 35 + gcc/omp-selectors.h | 3 + .../c-c++-common/gomp/adjust-args-1.c | 30 + .../c-c++-common/gomp/adjust-args-2.c | 31 + .../c-c++-common/gomp/declare-variant-2.c | 4 +- gcc/testsuite/c-c++-common/gomp/dispatch-1.c | 65 ++ gcc/testsuite/c-c++-common/gomp/dispatch-2.c | 28 + gcc/testsuite/c-c++-common/gomp/dispatch-3.c | 15 + gcc/testsuite/c-c++-common/gomp/dispatch-4.c | 18 + gcc/testsuite/c-c++-common/gomp/dispatch-5.c | 26 + gcc/testsuite/c-c++-common/gomp/dispatch-6.c | 19 + gcc/testsuite/c-c++-common/gomp/dispatch-7.c | 28 + gcc/testsuite/g++.dg/gomp/adjust-args-1.C | 39 ++ gcc/testsuite/g++.dg/gomp/adjust-args-2.C | 51 ++ gcc/testsuite/g++.dg/gomp/dispatch-1.C | 53 ++ gcc/testsuite/g++.dg/gomp/dispatch-2.C | 62 ++ gcc/testsuite/gcc.dg/gomp/adjust-args-1.c | 32 + gcc/testsuite/gcc.dg/gomp/dispatch-1.c | 53 ++ .../gfortran.dg/gomp/adjust-args-1.f90 | 63 ++ .../gfortran.dg/gomp/adjust-args-2.f90 | 18 + .../gfortran.dg/gomp/adjust-args-3.f90 | 26 + .../gfortran.dg/gomp/adjust-args-4.f90 | 58 ++ .../gfortran.dg/gomp/adjust-args-5.f90 | 58 ++ .../gfortran.dg/gomp/declare-variant-2.f90 | 6 +- .../gomp/declare-variant-21-aux.f90 | 18 + .../gfortran.dg/gomp/declare-variant-21.f90 | 28 + gcc/testsuite/gfortran.dg/gomp/dispatch-1.f90 | 77 +++ gcc/testsuite/gfortran.dg/gomp/dispatch-2.f90 | 79 +++ gcc/testsuite/gfortran.dg/gomp/dispatch-3.f90 | 39 ++ gcc/testsuite/gfortran.dg/gomp/dispatch-4.f90 | 19 + gcc/testsuite/gfortran.dg/gomp/dispatch-5.f90 | 24 + gcc/testsuite/gfortran.dg/gomp/dispatch-6.f90 | 38 ++ gcc/testsuite/gfortran.dg/gomp/dispatch-7.f90 | 27 + gcc/testsuite/gfortran.dg/gomp/dispatch-8.f90 | 39 ++ gcc/tree-core.h | 7 + gcc/tree-inline.cc | 7 + gcc/tree-pretty-print.cc | 21 + gcc/tree.cc | 4 + gcc/tree.def | 5 + gcc/tree.h | 7 + libgomp/libgomp.texi | 4 +- libgomp/testsuite/libgomp.c/dispatch-1.c | 76 +++ 77 files changed, 3373 insertions(+), 141 deletions(-) create mode 100644 gcc/testsuite/c-c++-common/gomp/adjust-args-1.c create mode 100644 gcc/testsuite/c-c++-common/gomp/adjust-args-2.c create mode 100644 gcc/testsuite/c-c++-common/gomp/dispatch-1.c create mode 100644 gcc/testsuite/c-c++-common/gomp/dispatch-2.c create mode 100644 gcc/testsuite/c-c++-common/gomp/dispatch-3.c create mode 100644 gcc/testsuite/c-c++-common/gomp/dispatch-4.c create mode 100644 gcc/testsuite/c-c++-common/gomp/dispatch-5.c create mode 100644 gcc/testsuite/c-c++-common/gomp/dispatch-6.c create mode 100644 gcc/testsuite/c-c++-common/gomp/dispatch-7.c create mode 100644 gcc/testsuite/g++.dg/gomp/adjust-args-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/adjust-args-2.C create mode 100644 gcc/testsuite/g++.dg/gomp/dispatch-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/dispatch-2.C create mode 100644 gcc/testsuite/gcc.dg/gomp/adjust-args-1.c create mode 100644 gcc/testsuite/gcc.dg/gomp/dispatch-1.c create mode 100644 gcc/testsuite/gfortran.dg/gomp/adjust-args-1.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/adjust-args-2.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/adjust-args-3.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/adjust-args-4.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/adjust-args-5.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/declare-variant-21-aux.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/declare-variant-21.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/dispatch-1.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/dispatch-2.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/dispatch-3.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/dispatch-4.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/dispatch-5.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/dispatch-6.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/dispatch-7.f90 create mode 100644 gcc/testsuite/gfortran.dg/gomp/dispatch-8.f90 create mode 100644 libgomp/testsuite/libgomp.c/dispatch-1.c -- 2.45.2