public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tobias Burnus <burnus@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-827] OpenMP/Fortran: Reject nonintrinsic assignments in OMP WORKSHARE [PR100633]
Date: Mon, 17 May 2021 11:23:46 +0000 (GMT)	[thread overview]
Message-ID: <20210517112346.966B93846079@sourceware.org> (raw)

https://gcc.gnu.org/g:582776eb1b62c32f5234566a01ea92247b7d6bcc

commit r12-827-g582776eb1b62c32f5234566a01ea92247b7d6bcc
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Mon May 17 13:20:27 2021 +0200

    OpenMP/Fortran: Reject nonintrinsic assignments in OMP WORKSHARE [PR100633]
    
            PR fortran/100633
    
    gcc/fortran/ChangeLog:
    
            * resolve.c (gfc_resolve_code): Reject nonintrinsic assignments in
            OMP WORKSHARE.
    
    gcc/testsuite/ChangeLog:
    
            * gfortran.dg/gomp/workshare-59.f90: New test.

Diff:
---
 gcc/fortran/resolve.c                           |  6 ++++++
 gcc/testsuite/gfortran.dg/gomp/workshare-59.f90 | 26 +++++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index c02bbed8739..747516fbc1d 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -11940,6 +11940,12 @@ start:
 
 	  if (resolve_ordinary_assign (code, ns))
 	    {
+	      if (omp_workshare_flag)
+		{
+		  gfc_error ("Expected intrinsic assignment in OMP WORKSHARE "
+			     "at %L", &code->loc);
+		  break;
+		}
 	      if (code->op == EXEC_COMPCALL)
 		goto compcall;
 	      else
diff --git a/gcc/testsuite/gfortran.dg/gomp/workshare-59.f90 b/gcc/testsuite/gfortran.dg/gomp/workshare-59.f90
new file mode 100644
index 00000000000..65d04c2b55d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/workshare-59.f90
@@ -0,0 +1,26 @@
+! PR fortran/100633
+
+module defined_assign
+  interface assignment(=)
+    module procedure work_assign
+  end interface
+
+  contains
+    subroutine work_assign(a,b)
+      integer, intent(out) :: a
+      logical, intent(in) :: b(:)
+    end subroutine work_assign
+end module defined_assign
+
+program omp_workshare
+  use defined_assign
+
+  integer :: a
+  logical :: l(10)
+  l = .TRUE.
+
+  !$omp workshare
+  a = l   ! { dg-error "Expected intrinsic assignment in OMP WORKSHARE" }
+  !$omp end workshare
+
+end program omp_workshare


                 reply	other threads:[~2021-05-17 11:23 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=20210517112346.966B93846079@sourceware.org \
    --to=burnus@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).