re PR fortran/81841 (THREADPRIVATE (OpenMP) wrongly rejected in BLOCK DATA)
authorJakub Jelinek <jakub@gcc.gnu.org>
Thu, 23 Nov 2017 20:16:38 +0000 (21:16 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 23 Nov 2017 20:16:38 +0000 (21:16 +0100)
PR fortran/81841
* parse.c (parse_spec): Allow ST_OMP_THREADPRIVATE inside of
BLOCK DATA.

* libgomp.fortran/pr81841.f90: New test.

From-SVN: r255115

gcc/fortran/ChangeLog
gcc/fortran/parse.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.fortran/pr81841.f90 [new file with mode: 0644]

index a05bf83ee67a1c79c505c84a8be0e9b7faeb3635..57fe9684a4b96d5f119e224d8fb39c6be4102d8b 100644 (file)
@@ -1,3 +1,10 @@
+2017-11-23  Dirk Broemmel  <dibr-bugzilla@daswigwam.de>
+           Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/81841
+       * parse.c (parse_spec): Allow ST_OMP_THREADPRIVATE inside of
+       BLOCK DATA.
+
 2017-11-23  Mike Stump  <mikestump@comcast.net>
            Eric Botcazou  <ebotcazou@adacore.com>
 
index d025c9129217460091d4ee39432140de9b08e60e..08bff3f8615c3b0de6f3a645d28396b9882362dd 100644 (file)
@@ -3699,6 +3699,7 @@ loop:
        case ST_EQUIVALENCE:
        case ST_IMPLICIT:
        case ST_IMPLICIT_NONE:
+       case ST_OMP_THREADPRIVATE:
        case ST_PARAMETER:
        case ST_STRUCTURE_DECL:
        case ST_TYPE:
index 9999b060234ee8136b7b5c47d6cd9ea17af23d87..966b561c0618154b31328574092157b804dbae69 100644 (file)
@@ -1,3 +1,8 @@
+2017-11-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/81841
+       * libgomp.fortran/pr81841.f90: New test.
+
 2017-11-22  Jakub Jelinek  <jakub@redhat.com>
 
        PR libgomp/83106
diff --git a/libgomp/testsuite/libgomp.fortran/pr81841.f90 b/libgomp/testsuite/libgomp.fortran/pr81841.f90
new file mode 100644 (file)
index 0000000..176d1c8
--- /dev/null
@@ -0,0 +1,26 @@
+! PR fortran/81841
+! { dg-do run }
+
+block data
+  integer :: a
+  real :: b(2)
+  common /c/ a, b
+  !$omp threadprivate (/c/)
+  data a / 32 /
+  data b /2*1./
+end
+
+program pr81841
+  use omp_lib
+  integer :: e
+  real :: f(2)
+  common /c/ e, f
+  !$omp threadprivate (/c/)
+  !$omp parallel num_threads(8)
+  if ((e /= 32) .or. any(f /= 1.)) call abort
+  e = omp_get_thread_num ()
+  f = e + 19.
+  !$omp barrier
+  if ((e /= omp_get_thread_num ()) .or. any(f /= e + 19.)) call abort
+  !$omp end parallel
+end