diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2020-05-15 11:50:34 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2020-05-15 11:54:02 +0200 |
commit | 9f0f7da9aa98eec28b4e5e34ade0aa0028df161d (patch) | |
tree | 26d791efaa7de1a551f66e682ff7617f69f5a6af /gcc/gimplify.c | |
parent | 3a55774f0b67645efc54fa1ac8f0053053d566dd (diff) | |
download | gcc-9f0f7da9aa98eec28b4e5e34ade0aa0028df161d.zip gcc-9f0f7da9aa98eec28b4e5e34ade0aa0028df161d.tar.gz gcc-9f0f7da9aa98eec28b4e5e34ade0aa0028df161d.tar.bz2 |
[OpenMP] Fix 'omp exit data' for Fortran arrays (PR 94635)
gcc/
PR middle-end/94635
* gimplify.c (gimplify_scan_omp_clauses): For MAP_TO_PSET with
OMP_TARGET_EXIT_DATA, use 'release:' unless the associated
item is 'delete:'.
gcc/testsuite
PR middle-end/94635
* gfortran.dg/gomp/target-exit-data.f90: New.
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 1d532e6..e104e76 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -8766,7 +8766,9 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p, to be delete; hence, we turn the MAP_TO_PSET into a MAP_DELETE. */ if (code == OMP_TARGET_EXIT_DATA && OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_TO_PSET) - OMP_CLAUSE_SET_MAP_KIND (c, GOMP_MAP_DELETE); + OMP_CLAUSE_SET_MAP_KIND (c, OMP_CLAUSE_MAP_KIND (*prev_list_p) + == GOMP_MAP_DELETE + ? GOMP_MAP_DELETE : GOMP_MAP_RELEASE); else if ((code == OMP_TARGET_EXIT_DATA || code == OMP_TARGET_UPDATE) && (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER || OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_TO_PSET)) |