[Bug fortran/28885] New: ICE passing components of array of derived type

drewmccormack at mac dot com gcc-bugzilla@gcc.gnu.org
Tue Aug 29 08:55:00 GMT 2006


This ICE arises:


bug2.f90: In function ‘MAIN__’:
bug2.f90:30: internal compiler error: in gimplify_var_or_parm_decl, at
gimplify.c:1665


when compiling the following code:


module modA
  implicit none
  private 
  public :: sub
  interface sub
    module procedure subA
    module procedure subB
  end interface
contains
  subroutine subA(key,a)
    integer, intent(out)    :: a(:) 
    character(*),intent(in) :: key
    a = 1   
  end subroutine
  subroutine subB(key,a)
    real, intent(out) :: a(:) 
    character(*),intent(in) :: key
    a = 1.0 
  end subroutine
end module

program test
  use modA
  type t  
    integer :: i
    real :: energy
  end type
  type (t) :: a(5) 
  call sub('blah',a%energy)
  call sub('blah',a%i)
end program 


The ICE only occurs if you call the overloaded subroutine multiple times in the
same scope, for different components of the derived type. If you make one call
for one component, compilation succeeds.


-- 
           Summary: ICE passing components of array of derived type
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: drewmccormack at mac dot com
 GCC build triplet: gcc version 4.2.0 20060805 (experimental)
GCC target triplet: powerpc-apple-darwin8.7.0


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



More information about the Gcc-bugs mailing list