mbox

[0/5,gfortran] Support for allocate directive (OpenMP 5.0)

Message ID 20220113145320.3153087-1-abidh@codesourcery.com
Headers

Message

Abid Qadeer Jan. 13, 2022, 2:53 p.m. UTC
  This patch series add initial support for allocate directive in the
gfortran.  Although every allocate directive is parsed, only those
which are associated with an allocate statement are translated. The
lowering consists of replacing implicitly generated malloc/free call
from the allocate statement to GOMP_alloc and GOMP_free calls.

Hafiz Abid Qadeer (5):
  [gfortran] Add parsing support for allocate directive (OpenMP 5.0).
  [gfortran] Translate allocate directive (OpenMP 5.0).
  [gfortran] Handle cleanup of omp allocated variables (OpenMP 5.0).
  Gimplify allocate directive (OpenMP 5.0).
  Lower allocate directive  (OpenMP 5.0).

 gcc/doc/gimple.texi                           |  38 ++-
 gcc/fortran/dump-parse-tree.c                 |   3 +
 gcc/fortran/gfortran.h                        |   5 +-
 gcc/fortran/match.h                           |   1 +
 gcc/fortran/openmp.c                          | 229 +++++++++++++++++-
 gcc/fortran/parse.c                           |  10 +-
 gcc/fortran/resolve.c                         |   1 +
 gcc/fortran/st.c                              |   1 +
 gcc/fortran/trans-decl.c                      |  20 ++
 gcc/fortran/trans-openmp.c                    |  50 ++++
 gcc/fortran/trans.c                           |   1 +
 gcc/gimple-pretty-print.c                     |  37 +++
 gcc/gimple.c                                  |  10 +
 gcc/gimple.def                                |   6 +
 gcc/gimple.h                                  |  60 ++++-
 gcc/gimplify.c                                |  19 ++
 gcc/gsstruct.def                              |   1 +
 gcc/omp-low.c                                 | 125 ++++++++++
 gcc/testsuite/gfortran.dg/gomp/allocate-4.f90 | 112 +++++++++
 gcc/testsuite/gfortran.dg/gomp/allocate-5.f90 |  73 ++++++
 gcc/testsuite/gfortran.dg/gomp/allocate-6.f90 |  84 +++++++
 gcc/tree-core.h                               |   9 +
 gcc/tree-pretty-print.c                       |  23 ++
 gcc/tree.c                                    |   1 +
 gcc/tree.def                                  |   4 +
 gcc/tree.h                                    |  15 ++
 .../testsuite/libgomp.fortran/allocate-1.c    |   7 +
 .../testsuite/libgomp.fortran/allocate-2.f90  |  49 ++++
 28 files changed, 986 insertions(+), 8 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/allocate-4.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/allocate-5.f90
 create mode 100644 gcc/testsuite/gfortran.dg/gomp/allocate-6.f90
 create mode 100644 libgomp/testsuite/libgomp.fortran/allocate-1.c
 create mode 100644 libgomp/testsuite/libgomp.fortran/allocate-2.f90