- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hello!
I have encountered a strange error raised by `ifort -check shape` with `ifort (IFORT) 2021.2.0 20210228`. Here is a minimal working example.
! testshape.f90
program testshape
implicit none
integer :: a(1, 2)
a(:, 1:2) = a(:, 1:2) ! This line is OK. Benchmark for the erroneous line.
a(:, [1, 2]) = a(:, [1, 2]) ! Do nothing ..., but it triggers the error.
end program testshape
Name this code as `testshape.f90`, and then compile it. Here is what happens on my machine (Ubuntu 20.04).
```
$ ifort -check shape testshape.f90
testshape.f90(7): error #5581: Shape mismatch: The extent of dimension 1 of array A is 1 and the corresponding extent of array <RHS expression> is 2
a(:, [1, 2]) = a(:, [1, 2]) ! Do nothing ..., but it triggers the error.
^
compilation aborted for testshape.f90 (code 1)
```
If we remove `-check shape` or replace it with `-warn shape`, then everything works.
Did I misunderstand array indexing or miscalculate something in the code? Thank you for your attention.
- Balises:
- check shape
- Compile Error
- ifort
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
The fix is coming in the next Intel Fortran Compiler release 2021.7
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Some characters in the code part of your post have disappeared. Please edit your post and display the code using the code button (click on ..., then on </>).
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
The bug is not present in older versions of Ifort, such as 2013SP1 and 2016.0.8.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
> The bug is not present in older versions of Ifort, such as 2013SP1 and 2016.0.8.
Thank you for the verification. It seems that `-check shape` has not been available until 2018:
Thank you.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Thanks for reporting this. I filed a bug report on your behalf, CMPLRIL0-34245. I'll keep you posted on its progress to a fix.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
The fix is coming in the next Intel Fortran Compiler release 2021.7

- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable