replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Compiler crash
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compiler crash

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
acw



Joined: 04 Nov 2005
Posts: 165
Location: Darkest Devon

PostPosted: Tue Sep 11, 2012 10:22 am    Post subject: Compiler crash Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8211
Location: Salford, UK

PostPosted: Tue Sep 11, 2012 4:26 pm    Post subject: Reply with quote

I have logged this for investigation.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8211
Location: Salford, UK

PostPosted: Thu Mar 13, 2014 4:00 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group