Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
27237 Discussions

Internal compiler error (calculation of dimension)

Diehl__Martin
Novice
338 Views

The attached code results in an ICE with ifort 19.1.2.254 and older versions.

Seems to be related to the complex calculation of dimensions.

0 Kudos
4 Replies
Johannes_Rieke
New Contributor III
321 Views

Hi Martin, I can confirm the ICE.

replacing

integer(C_SIGNED_CHAR), dimension(size(bytes_raw,kind=pLongInt)-int(headerLen,pLongInt)) :: bytes

with

integer(C_SIGNED_CHAR), allocatable :: bytes(:) 
  allocate(bytes(size(bytes_raw,dim=1,kind=pLongInt)-int(headerLen,pLongInt)))

let the ICE disappear. I'm not sure, whether it helps you, because the context is not clear to me and you maybe know that already and wanted just to inform us.

However, an ICE should always be reported and a ticket be opened. All users will hopefully benefit from it

Diehl__Martin
Novice
317 Views

thanks for the confirmation

I actually use the same work around, so the ICE does not impact me a lot. Just two more lines and some #ifdefs

FortranFan
Honored Contributor II
301 Views

@Diehl__Martin ,

Agree re: the ICE, it's great you're reporting it, it helps everyone.

Re: a workaround, can you consider an alternative as shown below?

integer(C_SIGNED_CHAR), dimension(chunkLen)                         :: bytes

 

Something to keep in mind always is what's easier for a future reader of your code (which may be you yourself in a new incarnation which is basically any moment following the time you author your first draft) is also often easier on the processor (compiler).

Diehl__Martin
Novice
286 Views

@FortranFan: Thanks for the suggestion

I agree that that would be the better solution for this MWE. In the real library there are more functions and I want define always as `size(bytes) = size(bytes_raw) - headerLen`.

Reply