mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 03:47:02 -05:00
openmp: Bump Version from 4.5 to 5.2 (3/4)
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.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
! { dg-additional-options "-fopenmp-allocators" }
|
||||
! { dg-additional-options "-fdump-tree-omplower" }
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
program main
|
||||
use iso_c_binding
|
||||
use omp_lib
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
! { dg-additional-options "-fopenmp-allocators -fdump-tree-original" }
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
module m
|
||||
use omp_lib
|
||||
use iso_c_binding, only: c_intptr_t
|
||||
implicit none (type,external)
|
||||
integer(omp_allocator_handle_kind) :: handle
|
||||
integer(omp_allocator_handle_kind) :: handle
|
||||
integer(c_intptr_t) :: iptr
|
||||
end module m
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
! { dg-additional-options "-fopenmp-allocators" }
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
module m
|
||||
implicit none (type, external)
|
||||
type t
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
! { dg-additional-options "-fopenmp-allocators" }
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
module m
|
||||
implicit none
|
||||
type t
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
! { dg-do run }
|
||||
! { dg-additional-sources declare-target-2.f90 }
|
||||
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
module declare_target_1_mod
|
||||
integer :: var_x, var_y, var_z
|
||||
!$omp declare target(var_x)
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
! file compiled together with declare-target-1.f90
|
||||
! to verify inter-CU module handling of omp declare target.
|
||||
! { dg-do compile { target { lp64 && { ! lp64 } } } }
|
||||
|
||||
subroutine foo
|
||||
use declare_target_1_mod
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
! { dg-do run }
|
||||
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
module m
|
||||
contains
|
||||
integer function foo ()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
! { dg-do run }
|
||||
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
module m
|
||||
contains
|
||||
integer function foo ()
|
||||
|
||||
14
libgomp/testsuite/libgomp.fortran/dep-uses-allocators.f90
Normal file
14
libgomp/testsuite/libgomp.fortran/dep-uses-allocators.f90
Normal file
@@ -0,0 +1,14 @@
|
||||
! { dg-do compile }
|
||||
! { dg-warning "The specification of arguments to 'uses_allocators' at \\(1\\) where each item is of the form 'allocator\\(traits\\)' is deprecated since OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 11 }
|
||||
|
||||
program test
|
||||
use omp_lib
|
||||
implicit none
|
||||
integer(kind=omp_allocator_handle_kind) :: a1
|
||||
|
||||
type(omp_alloctrait), parameter :: trait(0) = [omp_alloctrait :: ]
|
||||
|
||||
!$omp target uses_allocators(omp_default_mem_alloc, a1(trait))
|
||||
! { dg-message "sorry, unimplemented: 'uses_allocators' clause with traits and memory spaces" "" { target *-*-* } .-1 }
|
||||
block; end block
|
||||
end program
|
||||
@@ -1,5 +1,5 @@
|
||||
! { dg-do run }
|
||||
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
integer, parameter :: N = 256
|
||||
integer, save :: a(N), b(N / 16, 8, 4), c(N / 32, 8, 8)
|
||||
integer, save, volatile :: d, e
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
! { dg-do run }
|
||||
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
integer, parameter :: N = 256
|
||||
integer, save :: a(N), b(N / 16, 8, 4), c(N / 32, 8, 8), g(N/16,8,6)
|
||||
integer, save, volatile :: d, e
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
! { dg-do run }
|
||||
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
integer, parameter :: N = 256
|
||||
integer, save :: a(N), b(N / 16, 8, 4), c(N / 32, 8, 8), g(N/16,8,6)
|
||||
integer, save, volatile :: d, e
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
! { dg-do run }
|
||||
!
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
! PR fortran/96668
|
||||
|
||||
module m
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
contains
|
||||
real function foo (x, y)
|
||||
real :: x, y
|
||||
!$omp declare simd linear (ref (x, y))
|
||||
!$omp declare simd linear (ref (x, y)) ! { dg-warning "Specification of the list items as arguments to the modifiers at \\(1\\) is deprecated since OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" }
|
||||
foo = x + y
|
||||
end function
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
! { 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
|
||||
@@ -25,7 +25,7 @@
|
||||
do i = 1, 1024
|
||||
if (c(i).ne.(6 * i)) stop 1
|
||||
end do
|
||||
contains
|
||||
contains
|
||||
function foo (x, y)
|
||||
type (p) :: x
|
||||
integer :: y(4), foo
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
cnt = -1
|
||||
|
||||
!$omp parallel num_threads (3) private (n) reduction (.or.:v) &
|
||||
!$omp & reduction (-:i, ia, r, ra, d, da, c, ca)
|
||||
!$omp & reduction (-:i, ia, r, ra, d, da, c, ca) ! { dg-warning "'-' operator at \\(1\\) for reductions deprecated in OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" }
|
||||
!$ if (i .ne. 0 .or. any (ia .ne. 0)) v = .true.
|
||||
!$ if (r .ne. 0 .or. any (ra .ne. 0)) v = .true.
|
||||
!$ if (d .ne. 0 .or. any (da .ne. 0)) v = .true.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
! { dg-do run }
|
||||
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
module udr11
|
||||
type dt
|
||||
integer :: x = 0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
! { dg-do compile }
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
|
||||
subroutine test
|
||||
use omp_lib
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
! { dg-do compile }
|
||||
|
||||
! { dg-additional-options "-Wno-deprecated-openmp" }
|
||||
! Minimal test for valid code:
|
||||
! - predefined allocators do not need any special treatment in uses_allocators
|
||||
! (as 'requires dynamic_allocators' is the default).
|
||||
|
||||
Reference in New Issue
Block a user