Here is a new version of the not-yet-committed parts of the series to add
support for  metadirectives and dynamic selectors.  At this point, the
middle-end support is in, but the front ends don't parse metadirectives,
nothing creates the new tree data structures, and there are no test cases.
This group of patches fills in those remaining pieces.

I've incorporated a fix for Tobias's recent comment about recognizing
C_OMP_DIR_META in the "assumes" directive in the C and C++ front ends, but
I've deferred fixing the wording of the existing error message because it
affects a pile of testcases unrelated to metadirectives, and also because
I want to tweak the Fortran message too.  I think I can address this later
using my documentation maintainer superpowers.  ;-)

I'm also deferring fixes for some of the other corner cases Tobias
found in his recent review comments on the C behavior that look like
rat holes.  At this point I think we are both on the same page as far
as not letting the perfect become the enemy of the good, and it will
be much easier to both hack up and review incremental improvements
once the base patches are in.

-Sandra


Sandra Loosemore (6):
  OpenMP: Add C support for metadirectives and dynamic selectors.
  OpenMP: C++ support for metadirectives and dynamic selectors.
  OpenMP: Shared metadirective/dynamic selector tests for C and C++
  OpenMP: Fortran support for metadirectives and dynamic selectors
  OpenMP: Update "declare target"/OpenMP context interaction
  OpenMP: Update documentation of metadirective implementation status.

 gcc/c-family/c-attribs.cc                     |   2 -
 gcc/c-family/c-common.h                       |   4 +-
 gcc/c-family/c-gimplify.cc                    |  27 +
 gcc/c-family/c-omp.cc                         |  60 +-
 gcc/c-family/c-pragma.cc                      |   1 +
 gcc/c-family/c-pragma.h                       |   1 +
 gcc/c/c-decl.cc                               |   8 +-
 gcc/c/c-parser.cc                             | 489 ++++++++++++++-
 gcc/cp/cp-tree.h                              |   2 +
 gcc/cp/decl2.cc                               |   9 +-
 gcc/cp/parser.cc                              | 541 +++++++++++++++-
 gcc/cp/parser.h                               |   6 +
 gcc/cp/pt.cc                                  | 126 ++++
 gcc/cp/semantics.cc                           |   3 +-
 gcc/fortran/decl.cc                           |  29 +
 gcc/fortran/dump-parse-tree.cc                |  20 +
 gcc/fortran/gfortran.h                        |  21 +-
 gcc/fortran/io.cc                             |   2 +-
 gcc/fortran/match.h                           |   2 +
 gcc/fortran/openmp.cc                         | 301 +++++++--
 gcc/fortran/parse.cc                          | 582 +++++++++++-------
 gcc/fortran/parse.h                           |   8 +-
 gcc/fortran/resolve.cc                        |   6 +
 gcc/fortran/st.cc                             |   4 +
 gcc/fortran/symbol.cc                         |  25 +-
 gcc/fortran/trans-decl.cc                     |   5 +-
 gcc/fortran/trans-openmp.cc                   | 233 ++++---
 gcc/fortran/trans-stmt.h                      |   1 +
 gcc/fortran/trans.cc                          |   1 +
 gcc/omp-general.cc                            |   2 +-
 .../c-c++-common/gomp/adjust-args-6.c         |  26 +
 .../c-c++-common/gomp/attrs-metadirective-1.c |  47 ++
 .../c-c++-common/gomp/attrs-metadirective-2.c |  76 +++
 .../c-c++-common/gomp/attrs-metadirective-3.c |  24 +
 .../c-c++-common/gomp/attrs-metadirective-4.c |  41 ++
 .../c-c++-common/gomp/attrs-metadirective-5.c |  26 +
 .../c-c++-common/gomp/attrs-metadirective-6.c |  33 +
 .../c-c++-common/gomp/attrs-metadirective-7.c |  42 ++
 .../c-c++-common/gomp/attrs-metadirective-8.c |  18 +
 .../gomp/declare-target-indirect-2.c          |  10 +-
 .../c-c++-common/gomp/declare-variant-2.c     |   4 +-
 .../c-c++-common/gomp/declare-variant-8.c     |   4 +-
 .../gomp/declare-variant-arg-exprs.c          |  29 +
 .../gomp/declare-variant-dynamic-1.c          |  26 +
 .../gomp/declare-variant-dynamic-2.c          |  30 +
 .../c-c++-common/gomp/metadirective-1.c       |  58 ++
 .../c-c++-common/gomp/metadirective-2.c       |  75 +++
 .../c-c++-common/gomp/metadirective-3.c       |  23 +
 .../c-c++-common/gomp/metadirective-4.c       |  40 ++
 .../c-c++-common/gomp/metadirective-5.c       |  25 +
 .../c-c++-common/gomp/metadirective-6.c       |  32 +
 .../c-c++-common/gomp/metadirective-7.c       |  41 ++
 .../c-c++-common/gomp/metadirective-8.c       |  17 +
 .../gomp/metadirective-construct.c            | 178 ++++++
 .../c-c++-common/gomp/metadirective-device.c  | 149 +++++
 .../gomp/metadirective-no-score.c             |  95 +++
 .../gomp/metadirective-target-device-1.c      | 151 +++++
 .../gomp/metadirective-target-device-2.c      | 132 ++++
 .../c-c++-common/gomp/reverse-offload-1.c     |   2 +-
 .../g++.dg/gomp/declare-variant-class-1.C     |  32 +
 .../g++.dg/gomp/declare-variant-class-2.C     |  37 ++
 .../g++.dg/gomp/metadirective-template-1.C    |  74 +++
 gcc/testsuite/gcc.dg/gomp/metadirective-1.c   |  15 +
 .../gfortran.dg/gomp/declare-variant-8.f90    |  12 +-
 .../gfortran.dg/gomp/metadirective-1.f90      |  80 +++
 .../gfortran.dg/gomp/metadirective-10.f90     |  40 ++
 .../gfortran.dg/gomp/metadirective-11.f90     |  33 +
 .../gfortran.dg/gomp/metadirective-12.f90     |  18 +
 .../gfortran.dg/gomp/metadirective-2.f90      |  62 ++
 .../gfortran.dg/gomp/metadirective-3.f90      |  25 +
 .../gfortran.dg/gomp/metadirective-4.f90      |  37 ++
 .../gfortran.dg/gomp/metadirective-5.f90      |  30 +
 .../gfortran.dg/gomp/metadirective-6.f90      |  31 +
 .../gfortran.dg/gomp/metadirective-7.f90      |  42 ++
 .../gfortran.dg/gomp/metadirective-8.f90      |  22 +
 .../gfortran.dg/gomp/metadirective-9.f90      |  30 +
 .../gomp/metadirective-construct.f90          | 260 ++++++++
 .../gomp/metadirective-no-score.f90           | 122 ++++
 gcc/testsuite/gfortran.dg/gomp/pure-1.f90     |   7 +
 gcc/testsuite/gfortran.dg/gomp/pure-2.f90     |   8 -
 libgomp/libgomp.texi                          |  21 +-
 .../libgomp.c++/metadirective-template-1.C    |  39 ++
 .../libgomp.c++/metadirective-template-2.C    |  43 ++
 .../libgomp.c++/metadirective-template-3.C    |  43 ++
 .../libgomp.c-c++-common/metadirective-1.c    |  37 ++
 .../libgomp.c-c++-common/metadirective-2.c    |  41 ++
 .../libgomp.c-c++-common/metadirective-3.c    |  36 ++
 .../libgomp.c-c++-common/metadirective-4.c    |  54 ++
 .../libgomp.c-c++-common/metadirective-5.c    |  48 ++
 .../metadirective-late-1.c                    |  66 ++
 .../metadirective-late-2.c                    |  66 ++
 .../metadirective-target-device.c             |  76 +++
 .../libgomp.fortran/metadirective-1.f90       |  61 ++
 .../libgomp.fortran/metadirective-2.f90       |  38 ++
 .../libgomp.fortran/metadirective-3.f90       |  29 +
 .../libgomp.fortran/metadirective-4.f90       |  46 ++
 .../libgomp.fortran/metadirective-5.f90       |  44 ++
 .../libgomp.fortran/metadirective-6.f90       |  58 ++
 98 files changed, 5394 insertions(+), 444 deletions(-)
 create mode 100644 gcc/testsuite/c-c++-common/gomp/adjust-args-6.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/attrs-metadirective-1.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/attrs-metadirective-2.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/attrs-metadirective-3.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/attrs-metadirective-4.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/attrs-metadirective-5.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/attrs-metadirective-6.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/attrs-metadirective-7.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/attrs-metadirective-8.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/declare-variant-arg-exprs.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/declare-variant-dynamic-1.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/declare-variant-dynamic-2.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-1.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-2.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-3.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-4.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-5.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-6.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-7.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-8.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-construct.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-device.c
 create mode 100644 gcc/testsuite/c-c++-common/gomp/metadirective-no-score.c
 create mode 100644 
gcc/testsuite/c-c++-common/gomp/metadirective-target-device-1.c
 create mode 100644 
gcc/testsuite/c-c++-common/gomp/metadirective-target-device-2.c
 create mode 100644 gcc/testsuite/g++.dg/gomp/declare-variant-class-1.C
 create mode 100644 gcc/testsuite/g++.dg/gomp/declare-variant-class-2.C
 create mode 100644 gcc/testsuite/g++.dg/gomp/metadirective-template-1.C
 create mode 100644 gcc/testsuite/gcc.dg/gomp/metadirective-1.c
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-1.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-10.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-11.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-12.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-2.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-3.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-4.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-5.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-6.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-7.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-8.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-9.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-construct.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/metadirective-no-score.f90
 create mode 100644 libgomp/testsuite/libgomp.c++/metadirective-template-1.C
 create mode 100644 libgomp/testsuite/libgomp.c++/metadirective-template-2.C
 create mode 100644 libgomp/testsuite/libgomp.c++/metadirective-template-3.C
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/metadirective-1.c
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/metadirective-2.c
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/metadirective-3.c
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/metadirective-4.c
 create mode 100644 libgomp/testsuite/libgomp.c-c++-common/metadirective-5.c
 create mode 100644 
libgomp/testsuite/libgomp.c-c++-common/metadirective-late-1.c
 create mode 100644 
libgomp/testsuite/libgomp.c-c++-common/metadirective-late-2.c
 create mode 100644 
libgomp/testsuite/libgomp.c-c++-common/metadirective-target-device.c
 create mode 100644 libgomp/testsuite/libgomp.fortran/metadirective-1.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/metadirective-2.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/metadirective-3.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/metadirective-4.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/metadirective-5.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/metadirective-6.f90

-- 
2.34.1

Reply via email to