This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/40176] New: Fortran 2003: Procedure pointers with array return value
- From: "janus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 May 2009 14:07:04 -0000
- Subject: [Bug fortran/40176] New: Fortran 2003: Procedure pointers with array return value
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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