- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Intel compiler appears to be somewhat special with array bounds checking. When array expressions (like slices) are involved, -check bounds does not trigger. The suggested "correct" version is -check shape, which however has annoying false positives.
Example:
subroutine test (j,js,si)
implicit none
integer :: js(3,2), j(10,2), si(1,3)
js(:,:) = j(si(1,:),:)
js(1:3,1:2) = j(si(1,1:3),1:2)
end subroutine test
% ifort -V -check shape -c ifort-shape.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.1 Build 20201112_000000
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.
Intel(R) Fortran 2021.1-2085
ifort-shape.f90(4): error #5581: Shape mismatch: The extent of dimension 1 of array JS is 3 and the corresponding extent of array J is 1
js(:,:) = j(si(1,:),:)
----------------^
ifort-shape.f90(5): error #5581: Shape mismatch: The extent of dimension 1 of array JS is 3 and the corresponding extent of array J is 1
js(1:3,1:2) = j(si(1,1:3),1:2)
----------------^
compilation aborted for ifort-shape.f90 (code 1)
I hope this can be fixed some day...
Harald
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This has been fixed already. Be on the lookout for the upcoming 2021.2 ifort.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This has been fixed already. Be on the lookout for the upcoming 2021.2 ifort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Indeed it is fixed in ifort 2021.2.0. (The -check options seem to be not yet implemented in ifx).
Thanks,
Harald

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page