fatal compiler error with array of structures

fatal compiler error with array of structures

Hi all, this one has me pulliing out my hair (what's left), can anyone offer advice?

I'm printing out from one element of an array of stuctures
1) This does not work
write (6,300) radpos, (items(it).values(i,j), items(it).acc(i,j), i=1,ndim1)

Compiling with Intel(R) Visual Fortran Compiler XE 12.1.0.233 [IA-32]... Fatal: There has been an internal compiler error (C0000005).

2) but when I take a copy of the element, it does work

type(cItem):: item
item = items(it)
write (6,300) radpos, (item.values(i,j), item.acc(i,j), i=1,ndim1)

I'm getting the error in debug and release mode and I've turned off optimisation and run-time checking. I have also noticed when I debug, the line-pointer (yellow arrow) is on the line below the active line. (I have cleaned and rebuilt). All my code is in modules.

type cItem
real:: values(MAX_RAKE,MAX_RADIAL) = 0.
real:: mean = 0.
real:: coeff1
character(len=6):: name = ' '
character(len=6):: typ = ' '
character(len=4):: plane = ' '
character(len=6):: pos = ' '
character(len=6):: useage= ' '
character(len=2):: conv = ' '
character(len=30):: com = ' '

character(len=50):: planeDes = ' '
character(len=1):: conf(MAX_RAKE,MAX_RADIAL)= ' '
character(len=1):: acc(MAX_RAKE,MAX_RADIAL) = '/' ! ' '=OK '/'=not found 'R'=Reject
integer:: dim1 = 0
integer:: dim2 = 0
logical:: isFound = .false.
end type

type (cItem):: items(0:N_ITEM_MAX)

6 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

Have you tried with the current release?

A minimum compilable source constructed from what you've posted works for me.

Note that your use of the period as a structure component selector (i.e. the dot in "item.values(i,j)") is not standard fortran.  The standard language uses a percent sign "item%values(i,j)".  Because dots are used to delimit operators I have come across instances where the parsing phase of the compiler gets rather confused if you use this dot structure component selector extension.  I haven't personally experienced ICE's from this - but I guess it is a possibility.

Did you try a more recent compiler ( 13.1, 14.0) ?  I quickly created a test based on your code lines above including the original WRITE statement  - it compiles without issues using the 14.0 compiler (64bit however). 
In case the newer compiler still shows the ICE, can you attach a small, complete (  compilable )  test case  ?

 

Did you try a more recent compiler ( 13.1, 14.0) ?  I quickly created a test based on your code lines above including the original WRITE statement  - it compiles without issues using the 14.0 compiler (64bit however). 
In case the newer compiler still shows the ICE, can you attach a small, complete (  compilable )  test case  ?

 

Hi HeinzB, thanks for your comments. I had tried the "%" instead of "." but it made no difference

I'd love to try a more recent (less buggy?) compiler version but unfortunately my license has expired.

I'll try to isolate a compilable source for you to test, but it will take me some time. I have a feeling though that this test code would work, and it is something else in the full code that is the problem. For instance I have noticed that when adding a "<n>" type FORMAT descriptor, my working code then had a fatal compiler error. It seems that something is making the compiler "on the edge".

I will send you a temporary license to try the latest compiler. This will clarify then at least, whether the issue is gone.

发表评论

登录添加评论。还不是成员?立即加入