I get the following ICE:

test.f90: In function ‘MAIN__’:
test.f90:29: internal compiler error: in gfc_get_symbol_decl, at
fortran/trans-decl.c:877
Please submit a full bug report,


when compiling this code:


module InternalCompilerError

   type Byte
      private 
      character(len=1)     :: singleByte
   end type

   type (Byte)             :: BytesPrototype(1)

   type UserType
      real :: r
   end type

contains

   function UserTypeToBytes(user) result (bytes) 
      type(UserType) :: user 
      type(Byte)     :: bytes(size(transfer(user, BytesPrototype)))
      bytes = transfer(user, BytesPrototype) 
   end function

   subroutine DoSomethingWithBytes(bytes)
      type(Byte), intent(in)     :: bytes(:)
   end subroutine

end module


program main
   use InternalCompilerError
   type (UserType) :: user 

   ! The following line causes the ICE 
   call DoSomethingWithBytes( UserTypeToBytes(user) )

end program 


As indicated in the comments, the ICE is caused by the line passing a function
result to a subroutine.

Kind regards,
Drew


-- 
           Summary: ICE involving transfer function, and passing function
                    return to subroutine
           Product: gcc
           Version: 4.3.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.3.0 20070325 (experimental)
GCC target triplet: powerpc-apple-darwin8


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

Reply via email to