backport: re PR fortran/81841 (THREADPRIVATE (OpenMP) wrongly rejected in BLOCK DATA)

Backported from mainline
	2017-11-23  Dirk Broemmel  <d.broemmel@fz-juelich.de>
		    Jakub Jelinek  <jakub@redhat.com>

	PR fortran/81841
	* parse.c (parse_spec): Allow ST_OMP_THREADPRIVATE inside of
	BLOCK DATA.

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

From-SVN: r255712
This commit is contained in:
Jakub Jelinek 2017-12-15 22:55:47 +01:00 committed by Jakub Jelinek
parent 8ea87c5f83
commit 29d1342c4b
4 changed files with 45 additions and 1 deletions

View File

@ -1,3 +1,13 @@
2017-12-15 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2017-11-23 Dirk Broemmel <d.broemmel@fz-juelich.de>
Jakub Jelinek <jakub@redhat.com>
PR fortran/81841
* parse.c (parse_spec): Allow ST_OMP_THREADPRIVATE inside of
BLOCK DATA.
2017-11-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83021
@ -7,7 +17,6 @@
2017-11-23 Paul Thomas <pault@gcc.gnu.org>
Backported from trunk
PR fortran/79072
* trans-expr.c (trans_class_vptr_len_assignment): Set from_len

View File

@ -3694,6 +3694,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:

View File

@ -1,3 +1,11 @@
2017-12-15 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
2017-11-23 Jakub Jelinek <jakub@redhat.com>
PR fortran/81841
* libgomp.fortran/pr81841.f90: New test.
2017-12-10 Tom de Vries <tom@codesourcery.com>
backport from trunk:

View File

@ -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