This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49397] New: ICE with proc pointer assignment
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 13 Jun 2011 21:46:30 +0000
- Subject: [Bug fortran/49397] New: ICE with proc pointer assignment
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49397
Summary: ICE with proc pointer assignment
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code, rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
CC: janus@gcc.gnu.org
Let's claim the following code is valid.
Cf. Intepretation Request J3/11-198 at
http://j3-fortran.org/doc/meeting/195/11-198.txt
Without the "print *, f()" line, it is rejected with:
p => f ! (1)
1
Error: Invalid procedure pointer assignment at (1)
But with the line, one gets:
test.f90: In function 's':
test.f90:2:0: internal compiler error: in build_function_decl, at
fortran/trans-decl.c:1778
Program m5
Print *,f()
! Call s
Contains
Subroutine s
Procedure(Real),Pointer :: p
! Print *,g()
p => f ! (1)
! Print *,p()
! p => g ! (2)
! Print *,p()
End Subroutine
End Program
Function f()
f = 1
End Function
Function g()
g = 2
End Function