This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/36528] New: Cray pointer to function mishandled
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jun 2008 14:29:16 -0000
- Subject: [Bug fortran/36528] New: Cray pointer to function mishandled
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
http://groups.google.com/group/comp.lang.fortran/msg/86b65bad78e6af78
The following program should compile (with -fcray-pointer) and print on run
time:
integral f(x) u intervalu [0,1] = 0.49975004
integral f(x) u intervalu [0,1] = 0.49975004
sunf95 handles this correctly, however, gfortran fails at link time:
undefined reference to `fcn_'
pointer (pfcn, fcn)
pfcn = loc(p1) ! p1 is a function interface
y = y + fcn(x)*dx ! Directly calling p1
y = euler(0.0,1.0,0.0005,fcn)
The dump shows:
integer(kind=8) pfcn;
D.1063 = (integer(kind=8)) p1;
pfcn = D.1063;
y = <<< Unknown tree: call_expr
4
(real(kind=4) (*<T2ef>) (real(kind=4) &)) pfcn
&x >>>
(&x) * dx +y
y = euler (&C.1072, &C.1073, &C.1074, fcn);
Full source code, see link. I think the test was created/tested for ifort and
gives there an ICE.
--
Summary: Cray pointer to function mishandled
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36528