public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/40176]  New: Fortran 2003: Procedure pointers with array return value
@ 2009-05-17 14:07 janus at gcc dot gnu dot org
  2009-05-17 14:13 ` [Bug fortran/40176] " janus at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-05-17 14:07 UTC (permalink / raw)
  To: gcc-bugs

The following program compiles without errors, but gives a segfault at runtime:

PROGRAM test_prog

  PROCEDURE(triple), POINTER :: f

  ! This works
  print *,triple(2.,4.)

  ! This creates a Segmentation Fault
  f => triple
  print *,f(2.,4.)

CONTAINS

  FUNCTION triple(a,b) RESULT(tre)
    REAL, INTENT(in) :: a, b
    REAL :: tre(2)
    tre(1) = 3.*a
    tre(2) = 3.*b
  END FUNCTION triple

END PROGRAM test_prog

Reported by Barron Bichon.


-- 
           Summary: Fortran 2003: Procedure pointers with array return value
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: janus at gcc dot gnu dot org


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


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

end of thread, other threads:[~2009-06-12 20:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-17 14:07 [Bug fortran/40176] New: Fortran 2003: Procedure pointers with array return value janus at gcc dot gnu dot org
2009-05-17 14:13 ` [Bug fortran/40176] " janus at gcc dot gnu dot org
2009-05-18 12:28 ` janus at gcc dot gnu dot org
2009-05-18 16:59 ` janus at gcc dot gnu dot org
2009-05-25 14:48 ` janus at gcc dot gnu dot org
2009-05-25 20:06 ` dominiq at lps dot ens dot fr
2009-05-27 14:09 ` dominiq at lps dot ens dot fr
2009-06-12 20:40 ` janus at gcc dot gnu dot org
2009-06-12 20:45 ` janus at gcc dot gnu dot 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).