diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2022-08-17 16:19:58 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2022-08-17 16:19:58 +0200 |
commit | 1513512ec7d0751cba30c9c8804f2be462acfb9b (patch) | |
tree | c48a76e140ac29ce0f04eb4aa257758851740a69 /gcc/fortran | |
parent | 027b281f1e8de55d959695c7f1e80572fae6dbe7 (diff) | |
download | gcc-1513512ec7d0751cba30c9c8804f2be462acfb9b.zip gcc-1513512ec7d0751cba30c9c8804f2be462acfb9b.tar.gz gcc-1513512ec7d0751cba30c9c8804f2be462acfb9b.tar.bz2 |
Fortran: OpenMP fix declare simd inside modules and absent linear step [PR106566]
gcc/fortran/ChangeLog:
PR fortran/106566
* openmp.cc (gfc_match_omp_clauses): Fix setting linear-step value
to 1 when not specified.
(gfc_match_omp_declare_simd): Accept module procedures.
gcc/testsuite/ChangeLog:
PR fortran/106566
* gfortran.dg/gomp/declare-simd-4.f90: New test.
* gfortran.dg/gomp/declare-simd-5.f90: New test.
* gfortran.dg/gomp/declare-simd-6.f90: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/openmp.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc index a7eb6c3..5949077 100644 --- a/gcc/fortran/openmp.cc +++ b/gcc/fortran/openmp.cc @@ -2480,7 +2480,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask, goto error; } } - else + if (step == NULL) { step = gfc_get_constant_expr (BT_INTEGER, gfc_default_integer_kind, @@ -4213,9 +4213,13 @@ gfc_match_omp_declare_simd (void) gfc_omp_declare_simd *ods; bool needs_space = false; - switch (gfc_match (" ( %s ) ", &proc_name)) + switch (gfc_match (" ( ")) { - case MATCH_YES: break; + case MATCH_YES: + if (gfc_match_symbol (&proc_name, /* host assoc = */ true) != MATCH_YES + || gfc_match (" ) ") != MATCH_YES) + return MATCH_ERROR; + break; case MATCH_NO: proc_name = NULL; needs_space = true; break; case MATCH_ERROR: return MATCH_ERROR; } |