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

nested types results in fortcom: Fatal: There has been an internal compiler error (C0000005)

chris_alford
Beginner
286 Views
Hi,
I'm pretty sure this is a compiler error,
and hopfully not something silly on my part,
but you never know !
Many thanks.


Compiling the 3 files attached (and also appearing at the bottom of this post)
results in the following output :-

1>------ Rebuild All started: Project: Console1, Configuration: Debug Win32 ------
1>Deleting intermediate files and output files for project 'Console1', configuration 'Debug|Win32'.
1>Compiling with Intel Visual Fortran Compiler XE 12.1.3.300 [IA-32]...
1>Types.f90
1>DataElement.f90
1>MikInterval.f90
1>fortcom: Fatal: There has been an internal compiler error (C0000005).
1>compilation aborted for D:\\AMS_trunk\\src\\Console1\\MikInterval.f90 (code 1)
1>
1>Console1 - 1 error(s), 0 warning(s)

The files are :-

modulem_Types
implicitnone
type,public::ACCUMULATION_TYPE
real::thing=1.0
endtypeACCUMULATION_TYPE

type,public::TYPED_FIELD
real::otherThing=1.0
endtypeTYPED_FIELD
 contains
 endmodulem_Types

modulem_dataElement
usem_Types
implicitnone
type,public::DATAELEMENT_TYPE
type(TYPED_FIELD)::typedField=TYPED_FIELD()
type(ACCUMULATION_TYPE)::accumulation=ACCUMULATION_TYPE()
endtypeDATAELEMENT_TYPE
contains
endmodulem_dataElement

modulem_mikInterval
usem_dataElement
implicitnone
type,public::MIK_INTERVAL_TYPE
type(DATAELEMENT_TYPE)::dataElement=DATAELEMENT_TYPE()
endtypeMIK_INTERVAL_TYPE
 contains
 endmodulem_mikInterval



0 Kudos
3 Replies
Steven_L_Intel1
Employee
286 Views
Internal compiler error is always a compiler bug, no matter what your code looks like. Thanks - I'll take a look at this in the morning.
0 Kudos
Steven_L_Intel1
Employee
286 Views
I have escalated this as issue DPD200179360. I found two workarounds. One is to explicitly specify the components when declaring MIK_INTERVAL_TYPE, for example:

type(DATAELEMENT_TYPE) :: dataElement = DATAELEMENT_TYPE(TYPED_FIELD(), ACCUMULATION_TYPE())

Another is to have all three of these type declarations in the same module, though that's messy for other reasons. Thanks for the nice example.
0 Kudos
Steven_L_Intel1
Employee
286 Views
I expect this to be fixed in a release later this year.
0 Kudos
Reply