public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/99514] New: incorrect Error: Threadprivate at (1) isn't SAVEd  ( implicit save via DATA initialization )
@ 2021-03-10 10:55 markus.weiland at ipp dot mpg.de
  2021-03-10 12:40 ` [Bug fortran/99514] " burnus at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: markus.weiland at ipp dot mpg.de @ 2021-03-10 10:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99514

            Bug ID: 99514
           Summary: incorrect Error: Threadprivate at (1) isn't SAVEd  (
                    implicit save via DATA initialization )
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: markus.weiland at ipp dot mpg.de
  Target Milestone: ---

Created attachment 50347
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50347&action=edit
minimal example source code to reproduce the error

Compiling the attached src file with:
gfortran -c src/minimal.f90 -fopenmp

gives the following error:

src/minimal.f90:7:12:

    7 |   DATA NTest /1/
      |            1
Error: Threadprivate at (1) isn't SAVEd


while compiling with ifort
ifort -c src/minimal.f90 -qopenmp

works without error.

I believe the ifort behavior is correct here, because the initialization of
NTest via DATA causes an implicit save, which seems not to be identified by
gfortran.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/99514] incorrect Error: Threadprivate at (1) isn't SAVEd  ( implicit save via DATA initialization )
  2021-03-10 10:55 [Bug fortran/99514] New: incorrect Error: Threadprivate at (1) isn't SAVEd ( implicit save via DATA initialization ) markus.weiland at ipp dot mpg.de
@ 2021-03-10 12:40 ` burnus at gcc dot gnu.org
  2021-03-10 13:02 ` dominiq at lps dot ens.fr
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-10 12:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99514

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to markus.weiland@ipp.mpg.de from comment #0)
> I believe the ifort behavior is correct here, because the initialization of
> NTest via DATA causes an implicit save, which seems not to be identified by
> gfortran.

Concur, except if there is a common (which there isn't):

F2018: 8.6.7  DATA statement
"Except for variables in named common blocks, a named variable has the
 SAVE attribute if any part of it is initialized in a DATA statement,
 and this may be confirmed by explicit specification."

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/99514] incorrect Error: Threadprivate at (1) isn't SAVEd  ( implicit save via DATA initialization )
  2021-03-10 10:55 [Bug fortran/99514] New: incorrect Error: Threadprivate at (1) isn't SAVEd ( implicit save via DATA initialization ) markus.weiland at ipp dot mpg.de
  2021-03-10 12:40 ` [Bug fortran/99514] " burnus at gcc dot gnu.org
@ 2021-03-10 13:02 ` dominiq at lps dot ens.fr
  2021-03-10 15:07 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-03-10 13:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99514

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-03-10
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
For the record

program main

  integer :: NTest = 1
  !$omp threadprivate(Ntest)

end program main

compiles.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/99514] incorrect Error: Threadprivate at (1) isn't SAVEd  ( implicit save via DATA initialization )
  2021-03-10 10:55 [Bug fortran/99514] New: incorrect Error: Threadprivate at (1) isn't SAVEd ( implicit save via DATA initialization ) markus.weiland at ipp dot mpg.de
  2021-03-10 12:40 ` [Bug fortran/99514] " burnus at gcc dot gnu.org
  2021-03-10 13:02 ` dominiq at lps dot ens.fr
@ 2021-03-10 15:07 ` burnus at gcc dot gnu.org
  2021-03-12 15:34 ` cvs-commit at gcc dot gnu.org
  2021-03-15 13:30 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-10 15:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99514

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566548.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/99514] incorrect Error: Threadprivate at (1) isn't SAVEd  ( implicit save via DATA initialization )
  2021-03-10 10:55 [Bug fortran/99514] New: incorrect Error: Threadprivate at (1) isn't SAVEd ( implicit save via DATA initialization ) markus.weiland at ipp dot mpg.de
                   ` (2 preceding siblings ...)
  2021-03-10 15:07 ` burnus at gcc dot gnu.org
@ 2021-03-12 15:34 ` cvs-commit at gcc dot gnu.org
  2021-03-15 13:30 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-12 15:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99514

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tobias Burnus <burnus@gcc.gnu.org>:

https://gcc.gnu.org/g:d0655763483008a421608d059cf26c93077621a9

commit r11-7649-gd0655763483008a421608d059cf26c93077621a9
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Fri Mar 12 16:34:10 2021 +0100

    Fortran/OpenMP: Accept implicit-save DATA vars for threadprivate [PR99514]

    gcc/fortran/ChangeLog:

            PR fortran/99514
            * resolve.c (resolve_symbol): Accept vars which are in DATA
            and hence (either) implicit SAVE (or in common).

    gcc/testsuite/ChangeLog:

            PR fortran/99514
            * gfortran.dg/gomp/threadprivate-1.f90: New test.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug fortran/99514] incorrect Error: Threadprivate at (1) isn't SAVEd  ( implicit save via DATA initialization )
  2021-03-10 10:55 [Bug fortran/99514] New: incorrect Error: Threadprivate at (1) isn't SAVEd ( implicit save via DATA initialization ) markus.weiland at ipp dot mpg.de
                   ` (3 preceding siblings ...)
  2021-03-12 15:34 ` cvs-commit at gcc dot gnu.org
@ 2021-03-15 13:30 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-03-15 13:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99514

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> ---
FIXED on mainline (GCC 11).

Thanks for the report!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-15 13:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 10:55 [Bug fortran/99514] New: incorrect Error: Threadprivate at (1) isn't SAVEd ( implicit save via DATA initialization ) markus.weiland at ipp dot mpg.de
2021-03-10 12:40 ` [Bug fortran/99514] " burnus at gcc dot gnu.org
2021-03-10 13:02 ` dominiq at lps dot ens.fr
2021-03-10 15:07 ` burnus at gcc dot gnu.org
2021-03-12 15:34 ` cvs-commit at gcc dot gnu.org
2021-03-15 13:30 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).