diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2022-07-04 21:50:23 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2022-07-04 21:50:23 +0200 |
commit | c3297044f0055880dd23ffbf641aa3a5860197e1 (patch) | |
tree | 528d5fb4cc80e005f3eb7ac7c9f06f394fc94bb5 /gcc/fortran/module.cc | |
parent | ce8dbe7d834b9264d7a5cd74d3ce6c750d28b3af (diff) | |
download | gcc-c3297044f0055880dd23ffbf641aa3a5860197e1.zip gcc-c3297044f0055880dd23ffbf641aa3a5860197e1.tar.gz gcc-c3297044f0055880dd23ffbf641aa3a5860197e1.tar.bz2 |
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 <jakub@redhat.com>
Diffstat (limited to 'gcc/fortran/module.cc')
-rw-r--r-- | gcc/fortran/module.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/fortran/module.cc b/gcc/fortran/module.cc index 85aa153..5ddabdc 100644 --- a/gcc/fortran/module.cc +++ b/gcc/fortran/module.cc @@ -4383,10 +4383,10 @@ mio_omp_declare_simd (gfc_namespace *ns, gfc_omp_declare_simd **odsp) } for (n = ods->clauses->lists[OMP_LIST_LINEAR]; n; n = n->next) { - if (n->u.linear_op == OMP_LINEAR_DEFAULT) + if (n->u.linear.op == OMP_LINEAR_DEFAULT) mio_name (4, omp_declare_simd_clauses); else - mio_name (32 + n->u.linear_op, omp_declare_simd_clauses); + mio_name (32 + n->u.linear.op, omp_declare_simd_clauses); mio_symbol_ref (&n->sym); mio_expr (&n->expr); } @@ -4438,7 +4438,7 @@ mio_omp_declare_simd (gfc_namespace *ns, gfc_omp_declare_simd **odsp) case 34: case 35: *ptrs[1] = n = gfc_get_omp_namelist (); - n->u.linear_op = (enum gfc_omp_linear_op) (t - 32); + n->u.linear.op = (enum gfc_omp_linear_op) (t - 32); t = 4; goto finish_namelist; } |