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.
36 lines
799 B
Fortran
36 lines
799 B
Fortran
! PR fortran/84418
|
|
! { dg-do run { target vect_simd_clones } }
|
|
! { dg-options "-fno-inline" }
|
|
! { dg-additional-options "-msse2" { target sse2_runtime } }
|
|
! { dg-additional-options "-mavx" { target avx_runtime } }
|
|
! { dg-additional-options "-Wno-deprecated-openmp" }
|
|
type p
|
|
integer :: i, j
|
|
end type
|
|
type(p) :: a(1024)
|
|
integer :: b(4,1024), c(1024)
|
|
integer :: i
|
|
do i = 1, 1024
|
|
a(i)%i = 2 * i
|
|
a(i)%j = 3 * i
|
|
b(1,i) = 4 * i
|
|
b(2,i) = 5 * i
|
|
b(3,i) = 6 * i
|
|
b(4,i) = 7 * i
|
|
end do
|
|
!$omp simd
|
|
do i = 1, 1024
|
|
c(i) = foo (a(i), b(:,i))
|
|
end do
|
|
do i = 1, 1024
|
|
if (c(i).ne.(6 * i)) stop 1
|
|
end do
|
|
contains
|
|
function foo (x, y)
|
|
type (p) :: x
|
|
integer :: y(4), foo
|
|
!$omp declare simd linear (ref (x, y))
|
|
foo = x%i + y(1)
|
|
end function
|
|
end
|