Commit a7c5803d by Tobias Burnus

[OpenMP] Fix 'omp exit data' for Fortran arrays (PR 94635)

        Backport from mainline
        2020-05-15  Tobias Burnus  <tobias@codesourcery.com>

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.
parent ed63feba
2020-05-19 Tobias Burnus <tobias@codesourcery.com>
Backport from mainline
2020-05-15 Tobias Burnus <tobias@codesourcery.com>
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:'.
2020-05-18 Martin Sebor <msebor@redhat.com>
PR middle-end/94940
......
......@@ -8789,7 +8789,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))
......
2020-05-19 Tobias Burnus <tobias@codesourcery.com>
Backport from mainline
2020-05-15 Tobias Burnus <tobias@codesourcery.com>
PR middle-end/94635
* gfortran.dg/gomp/target-exit-data.f90: New.
2020-05-18 Martin Sebor <msebor@redhat.com>
PR middle-end/94940
......@@ -18,7 +26,7 @@
2020-05-13 Mark Eggleston <markeggleston@gcc.gnu.org>
Backport from master
2020-05-13 Mark Eggleston <markeggleston@gcc.gnu.org>
2020-05-13 Mark Eggleston <markeggleston@gcc.gnu.org>
PR fortran/93497
* gfortran.dg/pr88025.f90: Change in wording of error.
......
! { dg-do compile }
! { dg-additional-options "-fdump-tree-omplower" }
!
! PR middle-end/94635
integer, allocatable :: one(:), two(:), three(:)
!$omp target enter data map(alloc:one)
!$omp target enter data map(alloc:two)
!$omp target enter data map(to:three)
! ...
!$omp target exit data map(delete:one)
!$omp target exit data map(release:two)
!$omp target exit data map(from:three)
end
! { dg-final { scan-tree-dump "omp target exit data map\\(delete:.*\\) map\\(delete:one \\\[len: .*\\\]\\)" "omplower" } }
! { dg-final { scan-tree-dump "omp target exit data map\\(release:.*\\) map\\(release:two \\\[len: .*\\\]\\)" "omplower" } }
! { dg-final { scan-tree-dump "omp target exit data map\\(from:.*\\) map\\(release:three \\\[len: .*\\\]\\)" "omplower" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment