]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
openmp: Bump Version from 4.5 to 5.2 (3/4)
authorsupers1ngular <supers1ngular@baylibre.com>
Thu, 11 Dec 2025 16:12:50 +0000 (08:12 -0800)
committersupers1ngular <supers1ngular@baylibre.com>
Thu, 11 Dec 2025 16:12:50 +0000 (08:12 -0800)
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.

55 files changed:
gcc/fortran/openmp.cc
gcc/testsuite/gfortran.dg/gomp/52-deps.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/allocate-14.f90
gcc/testsuite/gfortran.dg/gomp/allocate-16.f90
gcc/testsuite/gfortran.dg/gomp/allocate-5.f90
gcc/testsuite/gfortran.dg/gomp/allocate-6.f90
gcc/testsuite/gfortran.dg/gomp/allocate-7.f90
gcc/testsuite/gfortran.dg/gomp/allocators-3.f90
gcc/testsuite/gfortran.dg/gomp/declare-simd-2.f90
gcc/testsuite/gfortran.dg/gomp/declare-simd-6.f90
gcc/testsuite/gfortran.dg/gomp/declare-target-1.f90
gcc/testsuite/gfortran.dg/gomp/declare-target-2.f90
gcc/testsuite/gfortran.dg/gomp/declare-target-4.f90
gcc/testsuite/gfortran.dg/gomp/declare-target-5.f90
gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-1.f90
gcc/testsuite/gfortran.dg/gomp/declare-target-indirect-2.f90
gcc/testsuite/gfortran.dg/gomp/declare-variant-10.f90
gcc/testsuite/gfortran.dg/gomp/declare-variant-8.f90
gcc/testsuite/gfortran.dg/gomp/implicit-save.f90
gcc/testsuite/gfortran.dg/gomp/linear-1.f90
gcc/testsuite/gfortran.dg/gomp/linear-2.f90
gcc/testsuite/gfortran.dg/gomp/linear-3.f90
gcc/testsuite/gfortran.dg/gomp/linear-4.f90
gcc/testsuite/gfortran.dg/gomp/linear-6.f90
gcc/testsuite/gfortran.dg/gomp/map-12.f90
gcc/testsuite/gfortran.dg/gomp/map-6.f90
gcc/testsuite/gfortran.dg/gomp/map-7.f90
gcc/testsuite/gfortran.dg/gomp/map-8.f90
gcc/testsuite/gfortran.dg/gomp/order-8.f90
gcc/testsuite/gfortran.dg/gomp/pr83977.f90
gcc/testsuite/gfortran.dg/gomp/reduction1.f90
gcc/testsuite/gfortran.dg/gomp/schedule-modifiers-2.f90
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-55.f90
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-56.f90
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-57.f90
gcc/testsuite/gfortran.dg/gomp/workshare-reduction-58.f90
libgomp/testsuite/libgomp.fortran/allocate-8a.f90
libgomp/testsuite/libgomp.fortran/allocators-1.f90
libgomp/testsuite/libgomp.fortran/allocators-2.f90
libgomp/testsuite/libgomp.fortran/allocators-4.f90
libgomp/testsuite/libgomp.fortran/declare-target-1.f90
libgomp/testsuite/libgomp.fortran/declare-target-2.f90
libgomp/testsuite/libgomp.fortran/declare-target-indirect-1.f90
libgomp/testsuite/libgomp.fortran/declare-target-indirect-2.f90
libgomp/testsuite/libgomp.fortran/dep-uses-allocators.f90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/doacross1.f90
libgomp/testsuite/libgomp.fortran/doacross2.f90
libgomp/testsuite/libgomp.fortran/doacross3.f90
libgomp/testsuite/libgomp.fortran/map-alloc-ptr-2.f90
libgomp/testsuite/libgomp.fortran/pr84418-1.f90
libgomp/testsuite/libgomp.fortran/pr84418-2.f90
libgomp/testsuite/libgomp.fortran/reduction1.f90
libgomp/testsuite/libgomp.fortran/udr11.f90
libgomp/testsuite/libgomp.fortran/uses_allocators_1.f90
libgomp/testsuite/libgomp.fortran/uses_allocators_2.f90

index a771f0dd2134e101bee3d3c1e215d9374b263f8c..e6997427fc5f8dbf4539734a67f08f96bee8ee4b 100644 (file)
@@ -1494,7 +1494,11 @@ gfc_match_omp_clause_reduction (char pc, gfc_omp_clauses *c, bool openacc,
   else if (gfc_match_char ('*') == MATCH_YES)
     rop = OMP_REDUCTION_TIMES;
   else if (gfc_match_char ('-') == MATCH_YES)
-    rop = OMP_REDUCTION_MINUS;
+    {
+      gfc_warning (OPT_Wdeprecated_openmp, "%<-%> operator at %C "
+       "for reductions deprecated in OpenMP 5.2");
+      rop = OMP_REDUCTION_MINUS;
+    }
   else if (gfc_match (".and.") == MATCH_YES)
     rop = OMP_REDUCTION_AND;
   else if (gfc_match (".or.") == MATCH_YES)
@@ -1852,7 +1856,13 @@ gfc_match_omp_clause_uses_allocators (gfc_omp_clauses *c)
       if (gfc_match ("%S ", &p->sym) != MATCH_YES)
        goto error;
       if (!has_modifiers)
-       gfc_match ("( %S ) ", &p->u2.traits_sym);
+       {
+         if (gfc_match ("( %S ) ", &p->u2.traits_sym) == MATCH_YES)
+           gfc_warning (OPT_Wdeprecated_openmp, "The specification of "
+             "arguments to %<uses_allocators%> at %L where each item is of "
+             "the form %<allocator(traits)%> is deprecated since OpenMP 5.2",
+             &p->where);
+       }
       else if (gfc_peek_ascii_char () == '(')
        {
          gfc_error ("Unexpected %<(%> at %C");
@@ -2907,6 +2917,10 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
                                 "at %C");
                      goto error;
                    }
+                 if (is_depend)
+                   gfc_warning (OPT_Wdeprecated_openmp, "%<source%> "
+                     "modifier with %<depend%> clause at %L deprecated "
+                     "since OpenMP 5.2, use with %<doacross%>", &old_loc);
                  c->doacross_source = true;
                  c->depend_source = is_depend;
                  continue;
@@ -2930,6 +2944,11 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
                                 "at %C");
                      goto error;
                    }
+                 if (is_depend)
+                   gfc_warning (OPT_Wdeprecated_openmp, "%<sink%> "
+                     "modifier with %<depend%> clause at %L "
+                     "deprecated since OpenMP 5.2, use with %<doacross%>",
+                     &old_loc);
                  m = gfc_match_omp_doacross_sink (&c->lists[OMP_LIST_DEPEND],
                                                   is_depend);
                  if (m == MATCH_YES)
@@ -3405,6 +3424,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
              bool old_linear_modifier = false;
              gfc_omp_linear_op linear_op = OMP_LINEAR_DEFAULT;
              gfc_expr *step = NULL;
+             locus saved_loc = gfc_current_locus;
 
              if (gfc_match_omp_variable_list (" ref (",
                                               &c->lists[OMP_LIST_LINEAR],
@@ -3440,6 +3460,11 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
                  gfc_current_locus = old_loc;
                  break;
                }
+             if (old_linear_modifier)
+               gfc_warning (OPT_Wdeprecated_openmp,
+                 "Specification of the list items as arguments to the "
+                 "modifiers at %L is deprecated since OpenMP 5.2",
+                 &saved_loc);
              if (linear_op != OMP_LINEAR_DEFAULT)
                {
                  if (gfc_match (" :") == MATCH_YES)
@@ -3624,7 +3649,11 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
                    }
                  else
                    break;
-                 gfc_match (", ");
+                 if (gfc_match (", ") != MATCH_YES)
+                   gfc_warning (OPT_Wdeprecated_openmp,
+                     "The specification of modifiers without comma "
+                     "separators for the %<map%> clause at %C has "
+                     "been deprecated since OpenMP 5.2");
                }
 
              gfc_omp_map_op map_op = OMP_MAP_TOFROM;
@@ -4287,7 +4316,12 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
              if (m == MATCH_ERROR)
                goto error;
              if (m == MATCH_YES)
-               continue;
+               {
+                 gfc_warning (OPT_Wdeprecated_openmp, "%<to%> clause with "
+                   "%<declare target%> at %L deprecated since OpenMP 5.2, "
+                   "use %<enter%>", &old_loc);
+                 continue;
+               }
            }
          else if ((mask & OMP_CLAUSE_TO)
                   && gfc_match_motion_var_list ("to (", &c->lists[OMP_LIST_TO],
@@ -7056,17 +7090,21 @@ match_omp_metadirective (bool begin_p)
 
       locus variant_locus = gfc_current_locus;
 
-      if (gfc_match (" default ( ") == MATCH_YES)
-       default_p = true;
-      else if (gfc_match (" otherwise ( ") == MATCH_YES)
+      if (gfc_match ("default ( ") == MATCH_YES)
+       {
+         default_p = true;
+         gfc_warning (OPT_Wdeprecated_openmp,
+           "%<default%> clause with metadirective at %L "
+           "deprecated since OpenMP 5.2", &variant_locus);
+       }
+      else if (gfc_match ("otherwise ( ") == MATCH_YES)
        default_p = true;
-      else if (gfc_match (" when ( ") != MATCH_YES)
+      else if (gfc_match ("when ( ") != MATCH_YES)
        {
          gfc_error ("expected %<when%>, %<otherwise%>, or %<default%> at %C");
          gfc_current_locus = old_loc;
          return MATCH_ERROR;
        }
-
       if (default_p && default_seen)
        {
          gfc_error ("too many %<otherwise%> or %<default%> clauses "
@@ -9414,6 +9452,12 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
          && code->block->next
          && code->block->next->op == EXEC_ALLOCATE)
        {
+         if (code->op == EXEC_OMP_ALLOCATE)
+           gfc_warning (OPT_Wdeprecated_openmp,
+             "The use of one or more %<allocate%> directives with "
+             "an associated %<allocate%> statement at %L is "
+             "deprecated since OpenMP 5.2, use an %<allocators%> "
+             "directive", &code->loc);
          gfc_alloc *a;
          gfc_omp_namelist *n_null = NULL;
          bool missing_allocator = false;
@@ -9436,7 +9480,7 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
                           n->sym->name, &n->where);
              for (a = code->block->next->ext.alloc.list; a; a = a->next)
                if (a->expr->expr_type == EXPR_VARIABLE
-                   && a->expr->symtree->n.sym == n->sym)
+                 && a->expr->symtree->n.sym == n->sym)
                  {
                    gfc_ref *ref;
                    for (ref = a->expr->ref; ref; ref = ref->next)
diff --git a/gcc/testsuite/gfortran.dg/gomp/52-deps.f90 b/gcc/testsuite/gfortran.dg/gomp/52-deps.f90
new file mode 100644 (file)
index 0000000..9cb8233
--- /dev/null
@@ -0,0 +1,44 @@
+! { dg-error ".* at \\(1\\) requires '-fopenmp-allocators'" "" { target *-*-* } 24 }
+! { dg-warning "All files that might deallocate such a variable must be compiled with '-fopenmp-allocators'" "" { target *-*-* } 24 }
+program test_deprecations
+  integer :: i
+  integer :: j
+  integer, allocatable :: a(:)
+  integer :: x(10)
+  integer :: y, z
+
+  ! { dg-warning "'to' clause with 'declare target' at \\(1\\) deprecated since OpenMP 5.2, use 'enter' \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 11 }
+  !$omp declare target to(i)
+  !$omp do ordered(1)
+    do i = 1,10
+      ! { dg-warning "'source' modifier with 'depend' clause at \\(1\\) deprecated since OpenMP 5.2, use with 'doacross' \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 15 }
+      !$omp ordered depend(source)
+        j = i
+      ! { dg-warning "'sink' modifier with 'depend' clause at \\(1\\) deprecated since OpenMP 5.2, use with 'doacross' \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 18 }
+      !$omp ordered depend(sink : i)
+        j = i
+    end do
+  !$omp end do
+
+  ! { dg-warning "The use of one or more 'allocate' directives with an associated 'allocate' statement at \\(1\\) is deprecated since OpenMP 5.2, use an 'allocators' directive \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 24 }
+  !$omp allocate(a)
+    allocate(a(100))
+    do i = 1,100
+      a(i) = i
+    end do
+    deallocate(a)
+
+
+  ! { dg-warning "The specification of modifiers without comma separators for the 'map' clause at \\(1\\) has been deprecated since OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 33 }
+  !$omp target map(close to: x)
+    x = 1
+  !$omp end target
+
+  z = 1
+  ! { dg-warning "'-' operator at \\(1\\) for reductions deprecated in OpenMP 5.2 \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 39 }
+  !$omp parallel do reduction(-:z)
+  do y = 1,10
+      z = z - y
+  end do
+
+end program
index 4db950f90a7109aaaacaa2f70de64fb0bdf80c45..77738344cead9709f2c2fe9bd26d3e1efd5b6052 100644 (file)
@@ -1,5 +1,5 @@
 ! { dg-additional-options "-fcoarray=single -fcray-pointer" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 use iso_c_binding
 integer, parameter :: omp_allocator_handle_kind = c_intptr_t
@@ -38,7 +38,7 @@ subroutine coarrays(x)
   !$omp allocate(z) ! { dg-error "18:Unexpected coarray 'z' in 'allocate' at .1." }
     allocate(z(5)[*])
   x = 5
-end 
+end
 
 
 integer function f() result(res)
@@ -114,7 +114,7 @@ subroutine coarray_3
   integer :: x
   integer, allocatable :: a, b, c[:], d
   x = 5 ! executable stmt
-  !$omp allocators allocate(align(16): a,b) allocate(align(32) : d) 
+  !$omp allocators allocate(align(16): a,b) allocate(align(32) : d)
   allocate(a,b,c[*],d)  ! OK - Fortran allocator used for 'C'
 end
 
index 6c203e02d57ac826e51b09ce47ca1b44d919493d..6bba4536e4b92c6265778d77f0fc4b2abf2d783b 100644 (file)
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 integer, pointer :: ptr
 
 !$omp flush
@@ -5,6 +6,6 @@ integer, pointer :: ptr
 allocate(ptr)
 end
 
-! { dg-error "'!.OMP ALLOCATE' at .1. requires '-fopenmp-allocators'" "" { target *-*-* } 4 }
+! { dg-error "'!$OMP ALLOCATE' at .1. requires '-fopenmp-allocators'" "" { target *-*-* } 4 }
 ! { dg-warning "All files that might deallocate such a variable must be compiled with '-fopenmp-allocators'" "" { target *-*-* } 4 }
 ! { dg-note "This includes explicit DEALLOCATE, reallocation on intrinsic assignment, INTENT\\(OUT\\) for allocatable dummy arguments, and reallocation of allocatable components allocated with an OpenMP allocator" "" { target *-*-* } 0 }
index 28369ae876bfb1ef289d87ed3aeaf9cfdaec8960..3e1f9a0702823137a7c4f9eee803fc564d6275e2 100644 (file)
@@ -1,4 +1,5 @@
 ! { dg-additional-options "-fopenmp-allocators" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module my_omp_lib
   use iso_c_binding, only: c_intptr_t
   !use omp_lib
index 063431d3582a5390a876807685a9248284a32079..7b7d4fd464551a36dad87262de555f4cefcd239c 100644 (file)
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module my_omp_lib
   use iso_c_binding, only: c_intptr_t
   !use omp_lib
index e919f78ce6da33ebbfd291b5a7cc068684dd5bd3..81adf689ac35ad20c234668b2d5fc561d27c1d42 100644 (file)
@@ -1,4 +1,5 @@
 ! { dg-additional-options "-fmax-errors=1000" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module my_omp_lib
   use iso_c_binding, only: c_intptr_t
   !use omp_lib
index d0e31ee8727216f2d2fdb9ce2778b859b6f4667d..7cc43db735f50ef874d254d7208ce6aeaf1ad332 100644 (file)
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine f
   integer, allocatable :: A1, A2, B(:), C
   !$omp declare target
index 8f76774fd6e0cc3a4ee327161496524392833179..261bba3bea0b4d7ed5db481c043e22d60a7ee3f8 100644 (file)
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 function f1 (a, b, c, d, e, f)
   integer, value :: a, b, c
   integer :: d, e, f, f1
index 83f2c0ab7cb002d27ef28a2dad386a58d2d451bf..1f639748315cd0e74caf4cc67324c582c6624798 100644 (file)
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-additional-options "-fdump-tree-gimple" }
-!
+! { dg-additional-options "-Wno-deprecated-openmp" }
 ! PR fortran/106566
 !
 ! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare simd \\(linear\\(ref\\(0\\):4\\) simdlen\\(8\\)\\)\\)\\)" 2 "gimple" } }
index bf64e72d082fbcd934b4f147850b3055007d6a24..a02bb427f4f6971630627997ba3494ad4a9d0218 100644 (file)
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module declare_target_1
   !$omp declare target to (var_1, var_4) link (var_2, var_3) &
   !$omp & link (var_5) to (var_6)
index b4f1e52f7251bd900aaab63dfbf0c64a93d6aa14..235fcc871796e7b8682c682c94c638c3690f316d 100644 (file)
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module declare_target_2
   !$omp declare target to (a) link (a) ! { dg-error "mentioned multiple times in clauses of the same OMP DECLARE TARGET directive" }
   !$omp declare target (b)
index 296c0dbd869ddbbbe0e4512188325934f73d2d24..dd67ff58a34d3e292d05f33037c380348429280c 100644 (file)
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-additional-options "-fdump-tree-original" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine f1
   !$omp declare target device_type (any)  ! { dg-warning "OMP DECLARE TARGET directive at .1. with only DEVICE_TYPE or INDIRECT clauses is ignored" }
 end subroutine
index 0dacb8952295a1bc77bcd4f33ac9c91a91504b8a..04178613ffcfe120c2914c14d5a94e4fd9c74b85 100644 (file)
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine foo()
   !$omp declare target  to(foo) device_type(bar)  ! { dg-error "Expected HOST, NOHOST or ANY" }
 end
index 504c1a29813ec2fe09f4922045afa51e449db5c3..b50fb37027f5133672b2633d3f9f30890a428f09 100644 (file)
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
   integer :: a
   integer, parameter :: X = 1
index 4345c69b74bbd5e627e71b7ae1607fa167e69dbf..5c2c73170ddc4334f2da9abd636febb3cd30b892 100644 (file)
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp -fdump-tree-gimple" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 contains
   subroutine sub1
index 01f59c528087aed7575562792987c96318fc4ed7..0e0ab5180107e709aedc1269814d0366d716d6e3 100644 (file)
@@ -1,7 +1,7 @@
 ! { dg-do compile }
 ! { dg-additional-options "-cpp -foffload=disable -fdump-tree-gimple" }
 ! { dg-additional-options "-mavx512bw" { target { i?86-*-* x86_64-*-* } } }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 #undef i386
 
 program main
index e3935768bc4da1677059253758738dcd7e94d6cb..68ff1e1333e7ca394f55bfd2f1cf292b055ca99e 100644 (file)
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-additional-options "-fdump-tree-gimple" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 program main
   !$omp requires atomic_default_mem_order(seq_cst)
   !$omp declare target to (test3)
index 2af9647490e7ec219a0672b2b3efe45a5a61a836..041de9799c3418b0138aec16aa20b0b81f72eca2 100644 (file)
@@ -1,11 +1,11 @@
 subroutine foo
   integer :: n = 5, m = 7
-  !$omp declare target to(n)
+  !$omp declare target to(n) ! { dg-warning "'to' clause with 'declare target' at \\(1\\) deprecated since OpenMP 5.2, use 'enter' \\\[-Wdeprecated-openmp\\\]" }
   !$omp threadprivate (m)
 end
 
 program main
   integer :: i, j
-  !$omp declare target to(i)
+  !$omp declare target to(i) ! { dg-warning "'to' clause with 'declare target' at \\(1\\) deprecated since OpenMP 5.2, use 'enter' \\\[-Wdeprecated-openmp\\\]" }
   !$omp threadprivate (j)
 end
index 0d7eb8e3f8fd4f46a5565d68bcfbbfe64e322d79..cc306ba49a70b68c489bb0be4e1c3e4f056cccf6 100644 (file)
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine foo (x, y)
   integer :: i, x, y
   common /i/ i
index 88df96e9b8f1fcbd5e0ee5607352f453986e4bf2..31288a6e4305df87ebb42227c08a23fcc46a3d40 100644 (file)
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp -fdump-tree-original" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
   implicit none (type, external)
 
index dee87b1a899a48ac5141350ef2283f3146818603..ddbe4bc21ec28f1ce44d1cc303bc62c6e32966c9 100644 (file)
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m2
   implicit none (type, external)
 
index ac532f81000b3cd234ee9a134cee1ecebd4e781a..e72211e458dfad8b3092376db1964115da205d59 100644 (file)
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 implicit none
 
index 57693ba6de1b77aba26bdcc378fb176ca22950e5..42123e251ed740cb788970b93343e62bcd782661 100644 (file)
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 implicit none
 integer, parameter :: val = 1
index ac9a0f8aae0498712f6f155215775ab696f55c9c..e45ac73de3464fd4dd4f020907adf3127c972f03 100644 (file)
@@ -1,5 +1,5 @@
 ! { dg-additional-options "-fdump-tree-omplower -fdump-tree-original" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine foo
   implicit none
   integer :: a, b, b1
index 309f84543335635f931eeb68b1499a772c0a0b11..33df6900630f6236a00f2f6d4a6ee5fdc5dde46c 100644 (file)
@@ -1,5 +1,5 @@
 ! { dg-additional-options "-fdump-tree-original" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 implicit none
 
 integer :: a, b, b1, b2, b3, b4, b5, b6
index 317090acb508a76c60fd02049956af46b8c29d42..13c06ec01cf19973b3f6c1c69ee843185befa47f 100644 (file)
@@ -1,5 +1,5 @@
 ! { dg-additional-options "-fdump-tree-original" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 implicit none
 
 integer :: a, b, close, always, to, present
index 15ebdd68b95ba25f84d4413e7588b5b60c092864..c131291efad2de6f84ccfef319755bec3ff17bc7 100644 (file)
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 implicit none
 
 integer :: a
index 80b4b722be0ac53639e9063959ece258b0963d4c..37b138b09cb5f0e64e1a8af0bd0c95b279b9c74e 100644 (file)
@@ -1,3 +1,4 @@
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine f1 (a)
   integer :: a(*)
   integer i
index b8ad1a7e39c184fd084658477b183fc93071b357..dea5406dea8ca58006c7f601e43bfe1f309f1f3d 100644 (file)
@@ -1,6 +1,6 @@
 ! PR middle-end/83977
 ! { dg-do compile }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 integer function foo (a, b)
    integer :: a, b
 !$omp declare simd uniform(b) linear(ref(a):b)
index cdc530bf0f254d5479348f7de22ad0ee10ca0326..a9789361e9175adc1c2232210cd59c65d23d2486 100644 (file)
@@ -1,7 +1,7 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp -fmax-errors=100" }
 ! { dg-require-effective-target tls }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine foo (ia1)
 integer :: i1, i2, i3
 integer, dimension (*) :: ia1
index 537fba23c11199c8f926f165a23d3cea3faaa0b3..864a36ce3371a47456e29286008d667a63c9fb0c 100644 (file)
@@ -1,6 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-fopenmp" }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 subroutine foo
   integer :: i
   !$omp do schedule (nonmonotonic: static, 2)
index 4d2e1e509ef46296d3f58691b3aa726a41fd8c07..aa8effe3ec23a620f7b06ca3891d3f11d686faf7 100644 (file)
@@ -1,5 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-O2 -fopenmp -fdump-tree-optimized" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_doacross_start \[^\n\r]*, (?:2147483648|-2147483648), 0, " 1 "optimized" } }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_end " 1 "optimized" } }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_doacross_post " 1 "optimized" } }
index a5fa4c04c6fb3b7c8cbaf5fedeeb5202bc2cf5e0..2116192675715c3aa9febf289beb8e9cab650bda 100644 (file)
@@ -1,5 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-O2 -fopenmp -fdump-tree-optimized" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop(?:_ull)?_doacross_start \[^\n\r]*, (?:2147483649|-2147483647), 0, " 1 "optimized" } }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_end " 1 "optimized" } }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_doacross(?:_ull)?_post " 1 "optimized" } }
index 6c52abacfaa4b0e9fe5639b97effd045f57bfb93..f95ad77db0b8e3bacf5f6fb332bb0c0ec875eb0d 100644 (file)
@@ -1,5 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-O2 -fopenmp -fdump-tree-optimized" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop(?:_ull)?_doacross_start \[^\n\r]*, (?:2147483650|-2147483646), 1, " 1 "optimized" } }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_end " 1 "optimized" } }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_doacross(?:_ull)?_post " 1 "optimized" } }
index ae4f8bc5ef8f3a7729225c51a132bd8d3155b5ba..eae6277b5de3f25dc7422cfa5204f275c6f3b8ac 100644 (file)
@@ -1,5 +1,6 @@
 ! { dg-do compile }
 ! { dg-options "-O2 -fopenmp -fdump-tree-optimized" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_doacross_start \[^\n\r]*, (?:2147483651|-2147483645), 1, " 1 "optimized" } }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_loop_end " 1 "optimized" } }
 ! { dg-final { scan-tree-dump-times "__builtin_GOMP_doacross_post " 1 "optimized" } }
index 5f6c8c1e2717b77392c7514e685468fdfdae0907..00416ed1a193336cccf5a7dbfb115640eec2cdba 100644 (file)
@@ -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
index 935a37cd959490f5efcae317e816d48e2eca0371..8e1d1944fa5f408ba02e7d0d375b8ab3dc9f95e0 100644 (file)
@@ -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
 
index c42fbd31e3e11725e4cb67f820021b7a4a8c3aa7..ada24de61310530f6e7694e8ba192aa3105e63da 100644 (file)
@@ -1,4 +1,5 @@
 ! { dg-additional-options "-fopenmp-allocators" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
   implicit none (type, external)
   type t
index 12689ea41ac0fcf9b822bb083fb0189072fed6b0..a58c2d352839d8d6a858efa8a3783e2d6c17d382 100644 (file)
@@ -1,4 +1,5 @@
 ! { dg-additional-options "-fopenmp-allocators" }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 implicit none
 type t
index d9abf685a545c3cd9ccad3899ab05d3ae299aff1..894c54154958da550e8b64ea58600e3ecbcbfef0 100644 (file)
@@ -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)
index 2210fc5a52f588e9f2a088ca39f3845176ba4e05..12ec7bc92b3ba1cc48ac4877847a060e5c1a5e6f 100644 (file)
@@ -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
 
index 39a91dfcdcacc2d118617ff633a8653245247d53..7a870acd56c6b2be19bd008476a4ff289de4e76e 100644 (file)
@@ -1,5 +1,5 @@
 ! { dg-do run }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 contains
   integer function foo ()
index d3baa81dd079462a51dbaa6a820c4ee18ffa8135..bdb08b5ed806e8720a754680dafbf74002c74a5e 100644 (file)
@@ -1,5 +1,5 @@
 ! { dg-do run }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module m
 contains
   integer function foo ()
diff --git a/libgomp/testsuite/libgomp.fortran/dep-uses-allocators.f90 b/libgomp/testsuite/libgomp.fortran/dep-uses-allocators.f90
new file mode 100644 (file)
index 0000000..c48bca2
--- /dev/null
@@ -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
index 2b15e7d7d115e0d316a58ccabcd16c7f8417258b..da2d664816e73c4450680b2270585d5f15abe206 100644 (file)
@@ -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
index 213ac715f9eddca12bd9b8874f2b1768a825d451..47aa7d1873c3c07b881fa1cb1dc9aab18c2d0fb9 100644 (file)
@@ -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
index 5ba57008c6f3504ce72333f6bdc0997029ea53ee..6deaf7164e0c227fafcaca1c48b6ca1fbe8b58d8 100644 (file)
@@ -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
index c69a9bf44ad1288fd2c3c49820fac5a823b846a6..1ff6a7f9024da5a2fa4258cba7cc160a210f6a6a 100644 (file)
@@ -1,5 +1,5 @@
 ! { dg-do run }
-! 
+! { dg-additional-options "-Wno-deprecated-openmp" }
 ! PR fortran/96668
 
 module m
index 8547fceb79e857778b7cbf558c0c77bc9bf98df0..65dae5d0b0b06bd652736484d01f65774326ff30 100644 (file)
@@ -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
index 481e24e5d8a8bca0ff6b94f3909ae2399a62e5e7..0a50a539ae8c63a9e276c120aec9d5202bcd896e 100644 (file)
@@ -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
index 622a7059d6c650ec4ec0c5ddda25cccb6979ce61..f02526b715e559a025c084d25ef4fcffbaf70634 100644 (file)
@@ -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.
index 57989be4a01052bf1f789fa42f7acd1aa898216f..a60822cd7aabced7e3d38b2cce750d7390bd85d3 100644 (file)
@@ -1,5 +1,5 @@
 ! { dg-do run }
-
+! { dg-additional-options "-Wno-deprecated-openmp" }
 module udr11
   type dt
     integer :: x = 0
index 66984d98c893fe4123c1d2dbc87d6098cb96e3fa..46f18e20ed88a4e15a1e7870199be1b6e2b5816e 100644 (file)
@@ -1,4 +1,5 @@
 ! { dg-do compile }
+! { dg-additional-options "-Wno-deprecated-openmp" }
 
 subroutine test
   use omp_lib
index 07327969775849b09f79660343ad5c010fce1ece..0ab09975f490ef99436197e6c7664185c9177b1a 100644 (file)
@@ -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).