mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 03:47:02 -05:00
Implements the OpenMP 5.2 Fortran deprecations. Uses the warning established in patch 1/4, -Wdeprecated-openmp, for said deprecations. Similarly, we do not implement the relaxing of constraints for the interop construct since it is not a deprecation. However, the deprecation for 'uses_allocators' is implemented, since support exists in Fortran mainline. Additionally implements the Fortran-specific deprecation for executable allocate directives, and adds new tests. gcc/fortran/ChangeLog: * openmp.cc (gfc_match_omp_clause_reduction): Deprecate '-' operator for reductions. (gfc_match_omp_clause_uses_allocators): Deprecate allocator(traits) pattern for 'uses_allocators'. (gfc_match_omp_clauses): Deprecate 'sink' and 'source' for 'depend' clause. Deprecate list items as arguments with 'linear' clause. Deprecate non-comma-separated modifiers for the map clause. Deprecate 'to' clause with declare target. (gfc_match_omp_declare_target): Whitespace. (match_omp_metadirective): Deprecate 'default' clause on metadirectives. (resolve_omp_clauses): Deprecate executable allocate directives. libgomp/ChangeLog: * testsuite/libgomp.fortran/allocate-8a.f90: Suppress warnings. * testsuite/libgomp.fortran/allocators-1.f90: Ditto. * testsuite/libgomp.fortran/allocators-2.f90: Ditto. * testsuite/libgomp.fortran/allocators-4.f90: Ditto. * testsuite/libgomp.fortran/declare-target-1.f90: Ditto. * testsuite/libgomp.fortran/declare-target-2.f90: Ditto. * testsuite/libgomp.fortran/declare-target-indirect-1.f90: Ditto. * testsuite/libgomp.fortran/declare-target-indirect-2.f90: Ditto. * testsuite/libgomp.fortran/doacross1.f90: Ditto. * testsuite/libgomp.fortran/doacross2.f90: Ditto. * testsuite/libgomp.fortran/doacross3.f90: Ditto. * testsuite/libgomp.fortran/map-alloc-ptr-2.f90: Ditto. * testsuite/libgomp.fortran/pr84418-1.f90: Ditto. * testsuite/libgomp.fortran/pr84418-2.f90: Ditto. * testsuite/libgomp.fortran/reduction1.f90: Ditto. * testsuite/libgomp.fortran/udr11.f90: Ditto. * testsuite/libgomp.fortran/uses_allocators_1.f90: Ditto. * testsuite/libgomp.fortran/uses_allocators_2.f90: Ditto. * testsuite/libgomp.fortran/dep-uses-allocators.f90: New test. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/allocate-14.f90: Suppress warnings. * gfortran.dg/gomp/allocate-16.f90: Ditto. * gfortran.dg/gomp/allocate-5.f90: Ditto. * gfortran.dg/gomp/allocate-6.f90: Ditto. * gfortran.dg/gomp/allocate-7.f90: Ditto. * gfortran.dg/gomp/allocators-3.f90: Ditto. * gfortran.dg/gomp/declare-simd-2.f90: Ditto. * gfortran.dg/gomp/declare-simd-6.f90: Ditto. * gfortran.dg/gomp/declare-target-1.f90: Ditto. * gfortran.dg/gomp/declare-target-2.f90: Ditto. * gfortran.dg/gomp/declare-target-4.f90: Ditto. * gfortran.dg/gomp/declare-target-5.f90: Ditto. * gfortran.dg/gomp/declare-target-indirect-1.f90: Ditto. * gfortran.dg/gomp/declare-target-indirect-2.f90: Ditto. * gfortran.dg/gomp/declare-variant-10.f90: Ditto. * gfortran.dg/gomp/declare-variant-8.f90: Ditto. * gfortran.dg/gomp/implicit-save.f90: Ditto. * gfortran.dg/gomp/linear-1.f90: Ditto. * gfortran.dg/gomp/linear-2.f90: Ditto. * gfortran.dg/gomp/linear-3.f90: Ditto. * gfortran.dg/gomp/linear-4.f90: Ditto. * gfortran.dg/gomp/linear-6.f90: Ditto. * gfortran.dg/gomp/map-12.f90: Ditto. * gfortran.dg/gomp/map-6.f90: Ditto. * gfortran.dg/gomp/map-7.f90: Ditto. * gfortran.dg/gomp/map-8.f90: Ditto. * gfortran.dg/gomp/order-8.f90: Ditto. * gfortran.dg/gomp/pr83977.f90: Ditto. * gfortran.dg/gomp/reduction1.f90: Ditto. * gfortran.dg/gomp/schedule-modifiers-2.f90: Ditto. * gfortran.dg/gomp/workshare-reduction-55.f90: Ditto. * gfortran.dg/gomp/workshare-reduction-56.f90: Ditto. * gfortran.dg/gomp/workshare-reduction-57.f90: Ditto. * gfortran.dg/gomp/workshare-reduction-58.f90: Ditto. * gfortran.dg/gomp/52-deps.f90: New test.
59 lines
1.0 KiB
Fortran
59 lines
1.0 KiB
Fortran
! { dg-additional-options "-fopenmp-allocators" }
|
|
! { dg-additional-options "-Wno-deprecated-openmp" }
|
|
module m
|
|
implicit none
|
|
type t
|
|
integer, allocatable :: Acomp, Bcomp(:)
|
|
class(*), allocatable :: Ccomp, Dcomp(:)
|
|
end type t
|
|
contains
|
|
|
|
subroutine intout(c,d,e,f)
|
|
implicit none
|
|
class(t), intent(out) :: c,d(4)
|
|
class(t), allocatable, intent(out) :: e,f(:)
|
|
end
|
|
|
|
subroutine q(c,d,e,f)
|
|
implicit none
|
|
class(t) :: c,d(4)
|
|
class(t), allocatable :: e,f(:)
|
|
call intout(c,d,e,f)
|
|
end subroutine q
|
|
|
|
subroutine s
|
|
implicit none
|
|
type(t) :: xx
|
|
class(t), allocatable :: yy
|
|
integer :: i, iiiiii
|
|
i = 4
|
|
!$omp allocate
|
|
allocate(xx%Acomp, xx%Bcomp(4))
|
|
deallocate(xx%Acomp, xx%Bcomp)
|
|
|
|
!$omp allocate
|
|
allocate(integer :: xx%Ccomp, xx%Dcomp(4))
|
|
deallocate(xx%Ccomp, xx%Dcomp)
|
|
|
|
!$omp allocators allocate(yy)
|
|
allocate(t :: yy)
|
|
|
|
!$omp allocate
|
|
allocate(real :: xx%Ccomp, xx%Dcomp(4))
|
|
deallocate(xx%Ccomp, xx%Dcomp)
|
|
|
|
!$omp allocate
|
|
allocate(xx%Acomp, xx%Bcomp(4))
|
|
!$omp allocate
|
|
allocate(logical :: xx%Ccomp, xx%Dcomp(4))
|
|
|
|
iiiiii = 555
|
|
xx = t(1, [1,2])
|
|
end
|
|
|
|
end module
|
|
|
|
use m
|
|
call s
|
|
end
|