Hi. The code below causes the latest compiler to either generate an 'internal compiler error', or bring up a crash dialog. On older versions the compiler generates dodgy code, missing out the type initialisers. Changing the order of some of the use statements, or removing the type initialisers fixes the issue (see code comments).
! Compiling this generates an internal compiler error in 6.30, older versions just
! generate code that sometimes omits MyType initialisation
module TypeMod
type MyType
integer, pointer:: intArray(:) => NULL()
integer:: anInt = 0
integer:: anotherInt = 0 ! comment this out to get crash with dialog rather than 'internal compiler error'
end type MyType
end module TypeMod
module FunctionMod
contains
subroutine GetMyType(ht)
use TypeMod ! stick this above interface to stop crash
type(MyType), intent(out):: ht
end subroutine GetMyType
end module FunctionMod
module FirstMod
use TypeMod
end module FirstMod
module SecondMod
use FunctionMod
end module SecondMod
subroutine CrashTheCompiler()
use FirstMod ! swap use FirstMod and use SecondMod to stop crash
use SecondMod
use TypeMod
type(MyType):: ht2
end subroutine CrashTheCompiler
[/code]