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: unassig...@gcc.gnu.org
        ReportedBy: bur...@gcc.gnu.org
                CC: ja...@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

Reply via email to