Unexpected behaviour of ALL and ANY (bug?)

Unexpected behaviour of ALL and ANY (bug?)

I'm trying to use the ALL and ANY commands in a code similar to the following one:

...

integer :: Ordering(1:Number_Derivatives)

...

do i = 1, Number_Derivatives
do j = 1, Number_Derivatives
if(any(Ordering(1:i-1) == j)) cycle

...

enddo
enddo

Looking at the Fortran 95 standard and the Intel language reference guide, the previous code should not execute the cycle command when i = 1, since then the Mask for the command ANY has size zero, since the triplet turns out to be empty: 1:i-1 = 1:0.

Instead, the command any(Ordering(1:i-1) == j) for i = 1 returns nothing, not a true and not a false.

I would like to know if this is my interpretation error from the documents or it is a possible bug of the compiler.

Thanks in advance and greetings from Spain,

Miguel

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I forgot to mention that I'm using version 8.0 without additional patches.

Miguel

Hard to say without a runnable example. I don't know how you can say that the expression returns "nothing".

I would suggest trying the latest compiler update, and if the problem persists, come up with a small, runnable example and submit it to support.

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today