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 15:11:24 +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-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.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 5A01BC058EC0
- References: <2f2d738f-90d7-0efe-1caf-7e3a6387b0eb@daswigwam.de> <20170901120842.GJ2323@tucnak> <a7154299-b247-86ef-8c99-c4c508e9f7c3@daswigwam.de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Sep 01, 2017 at 02:27:40PM +0200, dbroemmel wrote:
> > This is wrong. Runtime testcases for OpenMP belong into libgomp/testsuite/.
> Well, that's a path where I found some Fortran OpenMP stuff, I didn't
> look for other places.
>
> > 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?
> That would suffice and is the first testcase I added to PR81841. It was
> suggested I could add runtime tests as well, so I tried.
If you really need a testcase, it would be enough to do something like:
use omp_lib
!$omp parallel num_threads(2)
int2 = omp_get_thread_num ()
!$omp barrier
if (int2 != omp_get_thread_num ()) call abort
!$omp end parallel
or so to ensure it has the threadprivate property by writing something
different to it in each thread and after barrier verifying it has the
expected value in each thread.
Jakub