]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
OpenMP: allow requires dynamic_allocators
authorAndrew Stubbs <ams@codesourcery.com>
Thu, 16 Dec 2021 15:30:05 +0000 (15:30 +0000)
committerAndrew Stubbs <ams@codesourcery.com>
Mon, 17 Jan 2022 15:55:37 +0000 (15:55 +0000)
There's no need to reject the dynamic_allocators requires directive because
we actually do support the feature, and it doesn't have to actually "do"
anything.

gcc/c/ChangeLog:

* c-parser.c (c_parser_omp_requires): Don't "sorry" dynamic_allocators.

gcc/cp/ChangeLog:

* parser.c (cp_parser_omp_requires): Don't "sorry" dynamic_allocators.

gcc/fortran/ChangeLog:

* openmp.c (gfc_match_omp_requires): Don't "sorry" dynamic_allocators.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/requires-8.f90: Reinstate dynamic allocators
requirement.

gcc/c/c-parser.c
gcc/cp/parser.c
gcc/fortran/openmp.c
gcc/testsuite/gfortran.dg/gomp/requires-8.f90

index 6ada0048f5a6158c4032eab4ed2fb74d652b109f..20774f75303723f62e8104b0b38a5af65be5fad0 100644 (file)
@@ -22583,7 +22583,7 @@ c_parser_omp_requires (c_parser *parser)
              c_parser_skip_to_pragma_eol (parser, false);
              return;
            }
-         if (p)
+         if (p && this_req != OMP_REQUIRES_DYNAMIC_ALLOCATORS)
            sorry_at (cloc, "%qs clause on %<requires%> directive not "
                            "supported yet", p);
          if (p)
index c06ed5e4dbd6474e85c2190a684dc996463de305..97e9aea69796b46545e9e9606f25329612c881a3 100644 (file)
@@ -46512,7 +46512,7 @@ cp_parser_omp_requires (cp_parser *parser, cp_token *pragma_tok)
              cp_parser_skip_to_pragma_eol (parser, pragma_tok);
              return false;
            }
-         if (p)
+         if (p && this_req != OMP_REQUIRES_DYNAMIC_ALLOCATORS)
            sorry_at (cloc, "%qs clause on %<requires%> directive not "
                            "supported yet", p);
          if (p)
index a204323f8838efb93a0f28d119e490ae2a0a4430..4a031975afceecec961dd1988c60cc306179fea8 100644 (file)
@@ -5412,7 +5412,8 @@ gfc_match_omp_requires (void)
       else
        goto error;
 
-      if (requires_clause & ~OMP_REQ_ATOMIC_MEM_ORDER_MASK)
+      if (requires_clause & ~(OMP_REQ_ATOMIC_MEM_ORDER_MASK
+                             | OMP_REQ_DYNAMIC_ALLOCATORS))
        gfc_error_now ("Sorry, %qs clause at %L on REQUIRES directive is not "
                       "yet supported", clause, &old_loc);
       if (!gfc_omp_requires_add_clause (requires_clause, clause, &old_loc, NULL))
index 3c32ae9860e57cb320d1967e8747edf374a77f0e..eadfcaf8609b8499ad12d93242fb3be34d21b957 100644 (file)
@@ -4,7 +4,7 @@ contains
  subroutine foo
   interface
    subroutine bar2
-     !$!omp requires dynamic_allocators
+     !$omp requires dynamic_allocators
    end subroutine
   end interface
   !$omp target