This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for [Bug fortran/81841] [5/6/7/8 Regression] THREADPRIVATE (OpenMP) wrongly rejected in BLOCK DATA
- From: Jakub Jelinek <jakub at redhat dot com>
- To: dbroemmel <dibr-bugzilla at daswigwam dot de>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 1 Sep 2017 14:08:42 +0200
- Subject: Re: Patch for [Bug fortran/81841] [5/6/7/8 Regression] THREADPRIVATE (OpenMP) wrongly rejected in BLOCK DATA
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 98B96C9D25
- References: <2f2d738f-90d7-0efe-1caf-7e3a6387b0eb@daswigwam.de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Sep 01, 2017 at 11:09:47AM +0200, dbroemmel wrote:
> Hi all,
>
> attached are a proposed fix and new testcase for PR81841. The
> THREADPRIVATE statement is currently wrongly rejected as part of BLOCK DATA.
>
> The testcase also does (very basic) runtime checks. It fails (compiling)
> prior to the patch and completes after. Tested on x86_64 GNU/Linux.
>
> Thanks,
> Dirk
>
>
> 2017-09-01 dbroemmel
The ChangeLog format is date two spaces real name two spaces <email@address>
>
> PR fortran/81841
> * parse.c (parse_spec): adding ST_OMP_THREADPRIVATE as allowed
Add instead of adding
Also all the ChangeLog lines except empty and ones starting with date
should be tab indented, not sure if it is your mailer that ate it or
omission.
> statement.
>
> 2017-09-01 dbroemmel
>
> PR fortran/81841
> * gfortran.dg/gomp/omp_threadprivate3.f90: New testcase.
> Index: gcc/fortran/parse.c
> ===================================================================
> --- gcc/fortran/parse.c (revision 251553)
> +++ gcc/fortran/parse.c (working copy)
> @@ -3694,6 +3694,7 @@
> case ST_EQUIVALENCE:
> case ST_IMPLICIT:
> case ST_IMPLICIT_NONE:
> + case ST_OMP_THREADPRIVATE:
> case ST_PARAMETER:
> case ST_STRUCTURE_DECL:
> case ST_TYPE:
This looks good.
> Index: gcc/testsuite/gfortran.dg/gomp/omp_threadprivate3.f90
> ===================================================================
> --- gcc/testsuite/gfortran.dg/gomp/omp_threadprivate3.f90 (revision 0)
> +++ gcc/testsuite/gfortran.dg/gomp/omp_threadprivate3.f90 (working copy)
> @@ -0,0 +1,158 @@
> +! { dg-do run }
This is wrong. Runtime testcases for OpenMP belong into libgomp/testsuite/.
That said, I fail to see why such a large testcase is needed, wouldn't a
simple
! PR fortran/81841
! { dg-do compile }
block data
implicit none
integer :: int2
real :: flt2
common /c_block_2/ int2, flt2
!$OMP THREADPRIVATE(/c_block_2/)
data int2, flt2 /2, 2.2/
end block data
testcase in gfortran.dg/gomp/ be sufficient here?
Jakub