public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/51266] New: Pointer initialization in PARAMETER
@ 2011-11-22 10:19 burnus at gcc dot gnu.org
  2011-11-22 15:48 ` [Bug fortran/51266] [F08] " burnus at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-11-22 10:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51266

             Bug #: 51266
           Summary: Pointer initialization in PARAMETER
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
            Blocks: 45290


The following program from
   http://groups.google.com/group/comp.lang.fortran/msg/38bbc52c641f4b13
is rejected with:

        TYPE(T), PARAMETER :: C = T(X)  !!!
                                    1
  Error: Parameter 'x' at (1) has not been declared or is a variable, which
  does not reduce to a constant expression

The check is wrong as one has a pointer initialization - and X is a valid REAL,
TARGET, SAVE variable. Without PARAMETER, the initialization works. I think
just the checking needs to be fixed. (Note this is a F2008 feature.)

Variant: Use "T()" an in the derived type  "P => X".


      PROGRAM MAIN
        TARGET X
        DATA X/0.0/
        TYPE T
          REAL, POINTER :: P
        END TYPE
        TYPE(T), PARAMETER :: C = T(X)  !!!
        READ *, X
        CALL SUBR()
      CONTAINS
        SUBROUTINE SUBR
          REAL, PARAMETER :: Y = C%P  !!!
         PRINT *, Y
        END SUBROUTINE
      END


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

* [Bug fortran/51266] [F08] Pointer initialization in PARAMETER
  2011-11-22 10:19 [Bug fortran/51266] New: Pointer initialization in PARAMETER burnus at gcc dot gnu.org
@ 2011-11-22 15:48 ` burnus at gcc dot gnu.org
  2012-04-15 19:55 ` janus at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-11-22 15:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51266

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-11-22 15:44:34 UTC ---
Hmm, I somehow have the feeling that encountered this bug already. See the
thread starting at http://j3-fortran.org/pipermail/j3/2011-November/004840.html

I think I concur with Malcolm that the code of comment 0 cannot be implemented
(at least not without combining the linker with the front-end compiler,
something no one wants to do):
  http://j3-fortran.org/pipermail/j3/2011-November/004851.html

On the other hand, I think Bob right at
  http://j3-fortran.org/pipermail/j3/2011-November/004857.html
that the current standard seems to have a loop hole.

I probably should have realized the discussion earlier - on the other hand, Bob
seems to insist (cf. link above) that the program is not only valid but should
also be valid - otherwise, I presume, he wouldn't have posted it at
comp.lang.fortran.

(A PR might already exist for this thread.)


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

* [Bug fortran/51266] [F08] Pointer initialization in PARAMETER
  2011-11-22 10:19 [Bug fortran/51266] New: Pointer initialization in PARAMETER burnus at gcc dot gnu.org
  2011-11-22 15:48 ` [Bug fortran/51266] [F08] " burnus at gcc dot gnu.org
@ 2012-04-15 19:55 ` janus at gcc dot gnu.org
  2012-04-15 20:04 ` janus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: janus at gcc dot gnu.org @ 2012-04-15 19:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51266

--- Comment #2 from janus at gcc dot gnu.org 2012-04-15 19:55:22 UTC ---
(In reply to comment #1)
> (A PR might already exist for this thread.)

Well, there is PR 45290 and PR 50410 comment 9, which are at least related.


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

* [Bug fortran/51266] [F08] Pointer initialization in PARAMETER
  2011-11-22 10:19 [Bug fortran/51266] New: Pointer initialization in PARAMETER burnus at gcc dot gnu.org
  2011-11-22 15:48 ` [Bug fortran/51266] [F08] " burnus at gcc dot gnu.org
  2012-04-15 19:55 ` janus at gcc dot gnu.org
@ 2012-04-15 20:04 ` janus at gcc dot gnu.org
  2015-08-30 10:14 ` dominiq at lps dot ens.fr
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: janus at gcc dot gnu.org @ 2012-04-15 20:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51266

--- Comment #3 from janus at gcc dot gnu.org 2012-04-15 20:03:47 UTC ---
(In reply to comment #2)
> > (A PR might already exist for this thread.)
> 
> Well, there is PR 45290 and PR 50410 comment 9, which are at least related.

And moreover there is PR 51076, which is really identical to this one.


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

* [Bug fortran/51266] [F08] Pointer initialization in PARAMETER
  2011-11-22 10:19 [Bug fortran/51266] New: Pointer initialization in PARAMETER burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-04-15 20:04 ` janus at gcc dot gnu.org
@ 2015-08-30 10:14 ` dominiq at lps dot ens.fr
  2015-08-30 10:16 ` dominiq at lps dot ens.fr
  2015-10-09  8:50 ` dominiq at lps dot ens.fr
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-08-30 10:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
*** Bug 51076 has been marked as a duplicate of this bug. ***


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

* [Bug fortran/51266] [F08] Pointer initialization in PARAMETER
  2011-11-22 10:19 [Bug fortran/51266] New: Pointer initialization in PARAMETER burnus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-08-30 10:14 ` dominiq at lps dot ens.fr
@ 2015-08-30 10:16 ` dominiq at lps dot ens.fr
  2015-10-09  8:50 ` dominiq at lps dot ens.fr
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-08-30 10:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2015-08-30
     Ever confirmed|0                           |1

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The links to  http://j3-fortran.org/pipermail/j3/* are dead!-(


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

* [Bug fortran/51266] [F08] Pointer initialization in PARAMETER
  2011-11-22 10:19 [Bug fortran/51266] New: Pointer initialization in PARAMETER burnus at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-08-30 10:16 ` dominiq at lps dot ens.fr
@ 2015-10-09  8:50 ` dominiq at lps dot ens.fr
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-09  8:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> The links to  http://j3-fortran.org/pipermail/j3/* are dead!-(

Updated links

http://mailman.j3-fortran.org/pipermail/j3/2011-November/004840.html
http://mailman.j3-fortran.org/pipermail/j3/2011-November/004851.html
http://mailman.j3-fortran.org/pipermail/j3/2011-November/004857.html


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

end of thread, other threads:[~2015-10-09  8:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-22 10:19 [Bug fortran/51266] New: Pointer initialization in PARAMETER burnus at gcc dot gnu.org
2011-11-22 15:48 ` [Bug fortran/51266] [F08] " burnus at gcc dot gnu.org
2012-04-15 19:55 ` janus at gcc dot gnu.org
2012-04-15 20:04 ` janus at gcc dot gnu.org
2015-08-30 10:14 ` dominiq at lps dot ens.fr
2015-08-30 10:16 ` dominiq at lps dot ens.fr
2015-10-09  8:50 ` dominiq at lps dot ens.fr

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).