OG10 = devel/omp/gcc-10 I have merged releases/gcc-10 into that branch.
This included the 'Fortran: Fixes for OpenMP loop-iter privatization (PRs 95109 + 94690)' commit, which differs between mainline and GCC 10 – and OG10 is closer to mainline. Hence, the attached patch was committed as follow-up patch to add the missing bits. Tobias ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
commit b329c58936ebbceb845e557081b3a1d0243b0794 Author: Tobias Burnus <tob...@codesourcery.com> Date: Wed Sep 9 12:06:54 2020 +0200 Fortran: Fixes for OpenMP loop-iter privatization (PRs 95109 + 94690) Contains those parts of the mainline commit 61c2d476a52bb108bd05d0226c5522bf0c4b24b5 which are not in GCC 10 and, hence, not merged in f93eba8c5fde83100bf0854607848b6f50c8bbb2, i.e. the additional openmp.c change and the dump change for !nvptx. And the follow-up commit cbc12c582462c720adccef5097b3162cc77c37a2 which does: gfortran.dg/gomp/combined-if.f90: Update nvptx tree-dump times as nvptx has additional omp simd lines with _simt_ with -O1 and higher. gcc/fortran/ChangeLog: PR fortran/95109 PR fortran/94690 * openmp.c (gfc_resolve_do_iterator): Remove special code for SIMD, which is not needed. gcc/testsuite/ChangeLog: PR fortran/95109 PR fortran/94690 * gfortran.dg/gomp/combined-if.f90: Update scan-tree-dump-times for 'omp simd.*if'. (cherry picked from commit cbc12c582462c720adccef5097b3162cc77c37a2) --- gcc/fortran/ChangeLog.omp | 8 ++++++++ gcc/fortran/openmp.c | 25 ------------------------- gcc/testsuite/ChangeLog.omp | 8 ++++++++ gcc/testsuite/gfortran.dg/gomp/combined-if.f90 | 4 ++-- 4 files changed, 18 insertions(+), 27 deletions(-) diff --git a/gcc/fortran/ChangeLog.omp b/gcc/fortran/ChangeLog.omp index e5465e0eb63..986eb7d31f2 100644 --- a/gcc/fortran/ChangeLog.omp +++ b/gcc/fortran/ChangeLog.omp @@ -1,3 +1,11 @@ +2020-09-09 Tobias Burnus <tob...@codesourcery.com> + + Backport from mainline + 2020-09-09 Tobias Burnus <tob...@codesourcery.com> + + * openmp.c (gfc_resolve_do_iterator): Remove special code + for SIMD, which is not needed. + 2020-09-01 Tobias Burnus <tob...@codesourcery.com> Backport from mainline diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 2626730127b..334125e7f9a 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -6064,31 +6064,6 @@ gfc_resolve_do_iterator (gfc_code *code, gfc_symbol *sym, bool add_clause) if (omp_current_ctx->sharing_clauses->contains (sym)) return; - if (omp_current_ctx->is_openmp && omp_current_ctx->code->block) - { - /* SIMD is handled differently and, hence, ignored here. */ - gfc_code *omp_code = omp_current_ctx->code->block; - for ( ; omp_code->next; omp_code = omp_code->next) - switch (omp_code->op) - { - case EXEC_OMP_SIMD: - case EXEC_OMP_DO_SIMD: - case EXEC_OMP_PARALLEL_DO_SIMD: - case EXEC_OMP_DISTRIBUTE_SIMD: - case EXEC_OMP_DISTRIBUTE_PARALLEL_DO_SIMD: - case EXEC_OMP_TEAMS_DISTRIBUTE_SIMD: - case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD: - case EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD: - case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD: - case EXEC_OMP_TARGET_PARALLEL_DO_SIMD: - case EXEC_OMP_TARGET_SIMD: - case EXEC_OMP_TASKLOOP_SIMD: - return; - default: - break; - } - } - if (! omp_current_ctx->private_iterators->add (sym) && add_clause) { gfc_omp_clauses *omp_clauses = omp_current_ctx->code->ext.omp_clauses; diff --git a/gcc/testsuite/ChangeLog.omp b/gcc/testsuite/ChangeLog.omp index 132a4e7feba..d3e69738c1d 100644 --- a/gcc/testsuite/ChangeLog.omp +++ b/gcc/testsuite/ChangeLog.omp @@ -1,3 +1,11 @@ +2020-09-09 Tobias Burnus <tob...@codesourcery.com> + + Backport from mainline + 2020-09-09 Tobias Burnus <tob...@codesourcery.com> + + * gfortran.dg/gomp/combined-if.f90: Update scan-tree-dump-times + for 'omp simd.*if'. + 2020-09-01 Tobias Burnus <tob...@codesourcery.com> Backport from mainline diff --git a/gcc/testsuite/gfortran.dg/gomp/combined-if.f90 b/gcc/testsuite/gfortran.dg/gomp/combined-if.f90 index 0bb6c28b286..003821289a6 100644 --- a/gcc/testsuite/gfortran.dg/gomp/combined-if.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/combined-if.f90 @@ -104,6 +104,6 @@ contains end module ! { dg-final { scan-tree-dump-times "(?n)#pragma omp target.* if\\(" 9 "omplower" } } -! { dg-final { scan-tree-dump-times "(?n)#pragma omp simd.* if\\(" 4 "omplower" { target { ! offload_nvptx } } } } -! { dg-final { scan-tree-dump-times "(?n)#pragma omp simd.* if\\(" 7 "omplower" { target { offload_nvptx } } } } +! { dg-final { scan-tree-dump-times "(?n)#pragma omp simd.* if\\(" 5 "omplower" { target { ! offload_nvptx } } } } +! { dg-final { scan-tree-dump-times "(?n)#pragma omp simd.* if\\(" 9 "omplower" { target { offload_nvptx } } } } ! { dg-final { scan-tree-dump-times "(?n)#pragma omp parallel.* if\\(" 6 "omplower" } }