From c3297044f0055880dd23ffbf641aa3a5860197e1 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Mon, 4 Jul 2022 21:50:23 +0200 Subject: OpenMP/Fortran: Add support for OpenMP 5.2 linear clause syntax Fortran part to C/C++ commit r13-1002-g03b71406323ddc065b1d7837d8b43b17e4b048b5 gcc/fortran/ChangeLog: * gfortran.h (gfc_omp_namelist): Update by creating 'linear' struct, move 'linear_op' as 'op' to id and add 'old_modifier' to it. * dump-parse-tree.cc (show_omp_namelist): Update accordingly. * module.cc (mio_omp_declare_simd): Likewise. * trans-openmp.cc (gfc_trans_omp_clauses): Likewise. * openmp.cc (resolve_omp_clauses): Likewise; accept new-style 'val' modifier with do/simd. (gfc_match_omp_clauses): Handle OpenMP 5.2 linear clause syntax. libgomp/ChangeLog: * libgomp.texi (OpenMP 5.2): Mark linear-clause change as 'Y'. gcc/testsuite/ChangeLog: * c-c++-common/gomp/linear-4.c: New test. * gfortran.dg/gomp/linear-2.f90: New test. * gfortran.dg/gomp/linear-3.f90: New test. * gfortran.dg/gomp/linear-4.f90: New test. * gfortran.dg/gomp/linear-5.f90: New test. * gfortran.dg/gomp/linear-6.f90: New test. * gfortran.dg/gomp/linear-7.f90: New test. * gfortran.dg/gomp/linear-8.f90: New test. Co-authored-by: Jakub Jelinek --- gcc/fortran/dump-parse-tree.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/fortran/dump-parse-tree.cc') diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc index 85c0b98..5352008 100644 --- a/gcc/fortran/dump-parse-tree.cc +++ b/gcc/fortran/dump-parse-tree.cc @@ -1421,8 +1421,8 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n) case OMP_MAP_RELEASE: fputs ("release:", dumpfile); break; default: break; } - else if (list_type == OMP_LIST_LINEAR) - switch (n->u.linear_op) + else if (list_type == OMP_LIST_LINEAR && n->u.linear.old_modifier) + switch (n->u.linear.op) { case OMP_LINEAR_REF: fputs ("ref(", dumpfile); break; case OMP_LINEAR_VAL: fputs ("val(", dumpfile); break; @@ -1430,7 +1430,7 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n) default: break; } fprintf (dumpfile, "%s", n->sym ? n->sym->name : "omp_all_memory"); - if (list_type == OMP_LIST_LINEAR && n->u.linear_op != OMP_LINEAR_DEFAULT) + if (list_type == OMP_LIST_LINEAR && n->u.linear.op != OMP_LINEAR_DEFAULT) fputc (')', dumpfile); if (n->expr) { -- cgit v1.1