Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Compiler Assertion Failure

dannycat
New Contributor I
555 Views
I'm have trouble compiling a module using CVF 6.6c. I get the following message:

Assertion failure: Compiler internal error - please submit problem report
GEM ASSERTION, Compiler internal error - please submit problem report
f90: Fatal: There has been an internal compiler error (E0000003).
Error executing df.exe.

The module code that is being compiledis shown below:

module MenuDrawLib
!**********************************************************************************
! Display Menu Items with Toolbat Bitmaps
!**********************************************************************************

use dfwin

implicit none

! Private structure: one for each owner draw menu
type MYITEMDATA
integer(LONG) :: magicNum = 0
character*255 :: text = ' '
integer(UINT) :: fType = 0
integer(4) :: iButton = 0
end type
type(MYITEMDATA),allocatable :: m_ItemData(:)
type(MYITEMDATA) :: m_Item0
integer :: nItems

contains
!

integer function mm_OnMenuChar(info)
!***********************************************************************************
! User typed a char into menu. Look for item with & preceeding the char typed.
!***********************************************************************************

implicit none

! Arguments
type(T_MENUITEMINFO) :: info
!
! Local Variables
character*255 :: mmtext
type(MYITEMDATA) :: pmd

! Initialise
mm_OnMenuChar = 0
!
if(btest(info%fType,MFT_OWNERDRAW)) then
mmtext = pmd%text
endif
! mmtext = pmd%text

return
end function

end module

Note: the problem only occurs for Debug configurationBUT it will compile OK in IVF Debug & Release.
If the line "mmtext = pmd%text" is moved outside the IF / ENDIF the compiler works fine also.

Same thing happens on XP or Vista.

Can anyone explain what I'm doing wrong (unfortunately I can't use IVF yet) or if there is any work round to avoid this issue?

Thanks

0 Kudos
3 Replies
Paul_Curtis
Valued Contributor I
555 Views

  1. In your module function, the quantity pmd is local to the function, and is declared but not initialized, hence pmd%text is wholly undefined.
  2. Without SAVE there is no guarantee that the component values will be preserved over multiple invocations of the subroutine; this will be different for CVF (where SAVE was the default) vs IVF.
  3. The implicit initializations in the type(myitemdata) module definition should be replaced by an explicit constructor function which can be called whenever a new instance of that type is created.
0 Kudos
dannycat
New Contributor I
555 Views
Quoting - Paul Curtis

  1. In your module function, the quantity pmd is local to the function, and is declared but not initialized, hence pmd%text is wholly undefined.
  2. Without SAVE there is no guarantee that the component values will be preserved over multiple invocations of the subroutine; this will be different for CVF (where SAVE was the default) vs IVF.
  3. The implicit initializations in the type(myitemdata) module definition should be replaced by an explicit constructor function which can be called whenever a new instance of that type is created.
Paul, I agree with your response regarding the coding re initialisation (I would normally use pmd = m_Item0 to initialise pmd)but the example has been whittled down from a much larger module and thisshould not affect the compiler behaviour. I've since done futher investigation which indicates that the problem is caused by the btest function although I don't know why. When I create my own btestx function which simply performs the best(i,ibit) and replace the intrinsic function in the module the code compiles OK.


0 Kudos
Steven_L_Intel1
Employee
555 Views
CVF gets an error only when /debug is enabled for this module, so you could turn off generation of debug info for this source only and perhaps be ok.

For what it's worth, ifort compiles this ok.
0 Kudos
Reply