diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2020-09-09 09:33:51 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2020-09-09 09:33:51 +0200 |
commit | 61c2d476a52bb108bd05d0226c5522bf0c4b24b5 (patch) | |
tree | 77831ed52a09f74543818b2c7404420fb07d29e3 /gcc/fortran/openmp.c | |
parent | f56f1a5a755e4f2080ff709ad7bf4088b84faefe (diff) | |
download | gcc-61c2d476a52bb108bd05d0226c5522bf0c4b24b5.zip gcc-61c2d476a52bb108bd05d0226c5522bf0c4b24b5.tar.gz gcc-61c2d476a52bb108bd05d0226c5522bf0c4b24b5.tar.bz2 |
Fortran: Fixes for OpenMP loop-iter privatization (PRs 95109 + 94690)
This commit also fixes a gfortran.dg/gomp/target1.f90 regression;
target1.f90 tests the resolve.c and openmp.c changes.
gcc/fortran/ChangeLog:
PR fortran/95109
PR fortran/94690
* resolve.c (gfc_resolve_code): Also call
gfc_resolve_omp_parallel_blocks for 'distribute parallel do (simd)'.
* openmp.c (gfc_resolve_omp_parallel_blocks): Handle it.
(gfc_resolve_do_iterator): Remove special code for SIMD, which is
not needed.
* trans-openmp.c (gfc_trans_omp_target): For TARGET_PARALLEL_DO_SIMD,
call simd not do processing function.
gcc/testsuite/ChangeLog:
PR fortran/95109
PR fortran/94690
* gfortran.dg/gomp/combined-if.f90: Update scan-tree-dump-times for
'omp simd.*if'.
* gfortran.dg/gomp/openmp-simd-5.f90: New test.
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r-- | gcc/fortran/openmp.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index d0e516c..1efce33 100644 --- a/gcc/fortran/openmp.c +++ b/gcc/fortran/openmp.c @@ -5962,6 +5962,8 @@ gfc_resolve_omp_parallel_blocks (gfc_code *code, gfc_namespace *ns) switch (code->op) { + case EXEC_OMP_DISTRIBUTE_PARALLEL_DO: + case EXEC_OMP_DISTRIBUTE_PARALLEL_DO_SIMD: case EXEC_OMP_PARALLEL_DO: case EXEC_OMP_PARALLEL_DO_SIMD: case EXEC_OMP_TARGET_PARALLEL_DO: @@ -6047,31 +6049,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; |