Gio T wrote:
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 deprecation for 'uses_allocators'
since it is not yet in mainline,

(A patch for uses_allocators has been submitted 8 days ago and,
actually, there is already parsing support of that clause in gfortran,
but not yet in the C/C++ FE. Thus, it could have been implemented.)

@@ -2903,6 +2907,12 @@ 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);
+                   }

GCC style is to avoid { } if there is only a single statement
and no ambiguity (like nested ifs). (Multiple times)

@@ -3996,9 +4027,9 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const 
omp_mask mask,
-                 gfc_warning (OPT_Wdeprecated_openmp, "%<master%> affinity "
-                     "policy at %C deprecated since OpenMP 5.1, use "
-                     "%<primary%>");
+               gfc_warning (OPT_Wdeprecated_openmp, "%<master%> affinity "
+                 "policy at %L deprecated since OpenMP 5.1, use "
+                 "%<primary%>", &old_loc);
                c->proc_bind = OMP_PROC_BIND_MASTER;

This should be put into patch 1/4 – which added it at the first place.

@@ -6973,17 +7008,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)

For those wondering about the removed ' ': there is a
gfc_gobble_whitespace (); directly before the 'locus variant_locus'
line.


@@ -7005,8 +7044,7 @@ match_omp_metadirective (bool begin_p)
              != MATCH_YES)
            return MATCH_ERROR;
- if (gfc_match (" : ") != MATCH_YES)
-           {
+         if (gfc_match (" : ") != MATCH_YES) {

No, that's not GNU style.

* * *

+++ b/gcc/testsuite/gfortran.dg/gomp/52-deps.f90
@@ -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 }

I'd simply add '! { dg-additional-options "-fopenmp-allocators" }' to avoiding this error/warning.

+program test_deprecations

as this is a new test file and the other warning is already checked for.

* * *

Otherwise, LGTM.

Thanks for the patch!

Tobias

Reply via email to