This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for [Bug fortran/81841] [5/6/7/8 Regression] THREADPRIVATE (OpenMP) wrongly rejected in BLOCK DATA


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]