public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andrew Stubbs <ams@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-6641] OpenMP: allow requires dynamic_allocators
Date: Mon, 17 Jan 2022 15:56:33 +0000 (GMT)	[thread overview]
Message-ID: <20220117155633.4ACC33858D3C@sourceware.org> (raw)

https://gcc.gnu.org/g:450c85b81f4dd67bf6211d307afdc0f3c07ef44f

commit r12-6641-g450c85b81f4dd67bf6211d307afdc0f3c07ef44f
Author: Andrew Stubbs <ams@codesourcery.com>
Date:   Thu Dec 16 15:30:05 2021 +0000

    OpenMP: allow requires dynamic_allocators
    
    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.

Diff:
---
 gcc/c/c-parser.c                              | 2 +-
 gcc/cp/parser.c                               | 2 +-
 gcc/fortran/openmp.c                          | 3 ++-
 gcc/testsuite/gfortran.dg/gomp/requires-8.f90 | 2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 6ada0048f5a..20774f75303 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -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)
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index c06ed5e4dbd..97e9aea6979 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -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)
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index a204323f883..4a031975afc 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -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))
diff --git a/gcc/testsuite/gfortran.dg/gomp/requires-8.f90 b/gcc/testsuite/gfortran.dg/gomp/requires-8.f90
index 3c32ae9860e..eadfcaf8609 100644
--- a/gcc/testsuite/gfortran.dg/gomp/requires-8.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/requires-8.f90
@@ -4,7 +4,7 @@ contains
  subroutine foo
   interface
    subroutine bar2
-     !$!omp requires dynamic_allocators
+     !$omp requires dynamic_allocators
    end subroutine
   end interface
   !$omp target


                 reply	other threads:[~2022-01-17 15:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220117155633.4ACC33858D3C@sourceware.org \
    --to=ams@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).