In my attempt to use a parametrized derived type by initialization, I received a "Internal Compiler Error". Before filling in a software problem report, I want to ask may there be something wrong about below code snippet and the related behavior:
type :: flexible_data (k) integer, len :: k character(len=26),dimension(k) :: variable_size_array end type type(flexible_data(3)) :: FlexData1 = flexible_data(3)(['XYZ','YZX','ZXY'])
The compiler outputs the following error: ("Compiling with Intel(R) Visual Fortran Compiler XE 18.104.22.168 [IA-32]")
1>catastrophic error: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.
If I change the length of character to 25 (I am especially using 25 and 26 in order to express the problem; actually which I don't expect to be special numbers), the compilation succeeds without error. However the code snippet above seems to be compatible with specifications in https://software.intel.com/en-us/node/678531.
Furthermore If I attempt to use below line instead of the above initialization (considering examples at https://software.intel.com/en-us/node/678530):
type(flexible_data(:)), pointer:: FlexData1 = flexible_data(3)(['XYZ','YZX','ZXY'])
Regardless of the length of the character in definition, the compiler outputs again the "Internal Compiler Error".
An internal compiler error is ALWAYS a compiler bug. That said, you are using a three-year-old compiler and your first example compiles successfully with the current version 18 compiler.
The second example is not valid Fortran.