From 3b575376fbba16c3be9f607fbf53a6c841b3baae Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 23 Nov 2017 21:16:38 +0100 Subject: [PATCH] re PR fortran/81841 (THREADPRIVATE (OpenMP) wrongly rejected in BLOCK DATA) 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 | 7 +++++ gcc/fortran/parse.c | 1 + libgomp/ChangeLog | 5 ++++ libgomp/testsuite/libgomp.fortran/pr81841.f90 | 26 +++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 libgomp/testsuite/libgomp.fortran/pr81841.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a05bf83ee67..57fe9684a4b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2017-11-23 Dirk Broemmel + Jakub Jelinek + + PR fortran/81841 + * parse.c (parse_spec): Allow ST_OMP_THREADPRIVATE inside of + BLOCK DATA. + 2017-11-23 Mike Stump Eric Botcazou diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index d025c912921..08bff3f8615 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -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: diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 9999b060234..966b561c061 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2017-11-23 Jakub Jelinek + + PR fortran/81841 + * libgomp.fortran/pr81841.f90: New test. + 2017-11-22 Jakub Jelinek PR libgomp/83106 diff --git a/libgomp/testsuite/libgomp.fortran/pr81841.f90 b/libgomp/testsuite/libgomp.fortran/pr81841.f90 new file mode 100644 index 00000000000..176d1c8d9c0 --- /dev/null +++ b/libgomp/testsuite/libgomp.fortran/pr81841.f90 @@ -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 -- 2.30.2