View previous topic :: View next topic |
Author |
Message |
acw
Joined: 04 Nov 2005 Posts: 165 Location: Darkest Devon
|
Posted: Tue Sep 11, 2012 10:22 am Post subject: Compiler crash |
|
|
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).
Code: |
! 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] |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Tue Sep 11, 2012 4:26 pm Post subject: |
|
|
I have logged this for investigation. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Thu Mar 13, 2014 4:00 pm Post subject: |
|
|
Some progress has been made on this issue. The crash is now avoided but for the type initialisation to work you still need to put "USE TypMod" before the CONTAINS. This partial fix will be included in the next release. |
|
Back to top |
|
 |
|