The following code ICEs:

MODULE m
  IMPLICIT NONE

  TYPE t
    PROCEDURE(myproc), POINTER, PASS :: myproc
  END TYPE t

CONTAINS

  INTEGER FUNCTION myproc (me)
    CLASS(t), INTENT(IN) :: me
    myproc = 42
  END FUNCTION myproc

END MODULE m

PROGRAM main
  USE m
  IMPLICIT NONE

  TYPE(t) :: arr(2)
  arr%myproc => myproc
END PROGRAM main

Removing the line at the bottom assigning myproc to arr%myproc makes it
compile.  The relevant error is:

[/tmp]# gfortran-dev reduced.f90 
reduced.f90: In function 'MAIN__':
reduced.f90:17:0: internal compiler error: in gfc_conv_expr_descriptor, at
fortran/trans-array.c:5019
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 
           Summary: ICE in gfc_conv_expr_descriptor for array PPC assignment
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: domob at gcc dot gnu dot org


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

Reply via email to