Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Diehl__Martin
Beginner
250 Views

Internal compiler error (calculation of dimension)

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
233 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

Tags (1)
Diehl__Martin
Beginner
229 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 I
213 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
Beginner
198 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