diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2020-05-15 16:40:34 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2020-05-15 16:40:34 +0200 |
commit | 0ec52417fd9b3bef5227cdc9a18ff4f0247b0ea4 (patch) | |
tree | 77a2a73d7b426707efb9f5599b33067155ab798a /gcc/fortran/openmp.c | |
parent | 75514d157e9e28616c6de4e8c2740d8c87b6857d (diff) | |
download | gcc-0ec52417fd9b3bef5227cdc9a18ff4f0247b0ea4.zip gcc-0ec52417fd9b3bef5227cdc9a18ff4f0247b0ea4.tar.gz gcc-0ec52417fd9b3bef5227cdc9a18ff4f0247b0ea4.tar.bz2 |
[Fortran] OpenMP 5 – permit more sharing clauses for SIMD (PR94690)
gcc/fortran/
PR fortran/94690
* openmp.c (resolve_omp_do): Permit more clauses for SIMD
iteration variables.
gcc/testsuite/
PR fortran/94690
* gfortran.dg/gomp/openmp-simd-4.f90: New test.
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r-- | gcc/fortran/openmp.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 310d4e0..b246308 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -5847,26 +5847,21 @@ resolve_omp_do (gfc_code *code) "at %L", name, &do_code->loc); if (code->ext.omp_clauses) for (list = 0; list < OMP_LIST_NUM; list++) - if (!is_simd + if (!is_simd || code->ext.omp_clauses->collapse > 1 ? (list != OMP_LIST_PRIVATE && list != OMP_LIST_LASTPRIVATE) - : code->ext.omp_clauses->collapse > 1 - ? (list != OMP_LIST_LASTPRIVATE) - : (list != OMP_LIST_LINEAR)) + : (list != OMP_LIST_PRIVATE && list != OMP_LIST_LASTPRIVATE + && list != OMP_LIST_LINEAR)) for (n = code->ext.omp_clauses->lists[list]; n; n = n->next) if (dovar == n->sym) { - if (!is_simd) + if (!is_simd || code->ext.omp_clauses->collapse > 1) gfc_error ("%s iteration variable present on clause " "other than PRIVATE or LASTPRIVATE at %L", name, &do_code->loc); - else if (code->ext.omp_clauses->collapse > 1) - gfc_error ("%s iteration variable present on clause " - "other than LASTPRIVATE at %L", - name, &do_code->loc); else gfc_error ("%s iteration variable present on clause " - "other than LINEAR at %L", - name, &do_code->loc); + "other than PRIVATE, LASTPRIVATE or " + "LINEAR at %L", name, &do_code->loc); break; } if (i > 1) |