Regression: ICE on "result" keyword

Rouson, Damian rouson@sandia.gov
Fri Oct 5 23:20:00 GMT 2012


The Gfortran 4.8.0 20120930 ICE shown below appears to stem from the
"result" keyword used in the first interface body.  The code works fine
with gfortran 4.7.2.  This is a simplified version of code from my book:

$ cat integrand.F90
module integrand_module

  type ,abstract :: integrand
  contains
    procedure(t_interface), deferred :: t
    procedure(assign_interface), deferred :: assign
    procedure(times_interface), deferred :: times
    generic :: operator(*) => times
    generic :: assignment(=) => assign
  end type

  abstract interface
    function t_interface(this) result(dState_dt)
      import :: integrand
      class(integrand) ,intent(in)  :: this
      class(integrand) ,allocatable :: dState_dt
    end function 
    function times_interface(lhs,rhs)
      import :: integrand
      class(integrand) ,intent(in)  :: lhs
      class(integrand) ,allocatable :: times_interface
      real, intent(in)  :: rhs
    end function 
    subroutine assign_interface(lhs,rhs)
      import :: integrand
      class(integrand) ,intent(in)    :: rhs
      class(integrand) ,intent(inout) :: lhs
    end subroutine 
  end interface

contains
  subroutine integrate(model,dt)
    class(integrand) :: model
    real dt
    model = model%t()*dt
   end subroutine 
end module 
$ gfortran -c integrand.F90
integrand.F90: In function 'integrate':
integrand.F90:35:0: internal compiler error: in gfc_conv_expr, at
fortran/trans-expr.c:5862
     model = model%t()*dt
 ^

integrand.F90:35:0: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)
Abort trap: 6
remote-ca41:gnu-regression rouson$ gfortran --version
GNU Fortran (MacPorts gcc48 4.8-20120930_1) 4.8.0 20120930 (experimental)
Copyright (C) 2012 Free Software Foundation, Inc.





More information about the Fortran mailing list