- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
when compiled with "-check all", the following simple code fails at compile time or run time depending on which line is commented:
program test
implicit none
real :: kpt(3,64)
integer :: i,n
n = 9
kpt(:,n:) = kpt(:,[(i,i=64,n,-1)]) ! fails at run time
c kpt(:,9:) = kpt(:,[(i,i=64,9,-1)]) ! fails at compile time
end
Compile with:
ifort -check all test.f
Error message during compile time:
test.f(7): error #5581: Shape mismatch: The extent of dimension 1 of array KPT is 3 and the corresponding extent of array <RHS expression> is 56
kpt(:,9:) = kpt(:,[(i,i=64,9,-1)]) ! fails at compile time
------^
Error message during run time:
forrtl: severe (408): fort: (33): Shape mismatch: The extent of dimension 1 of array KPT is 3 and the corresponding extent of array <RHS expression> is 56
In my opinion, the error messages are incorrect. The dimension 1 of the RHS is also 3. The dimension 2 is 56 (on both sides).
ifort --version
ifort (IFORT) 19.0.3.199 20190206
Copyright (C) 1985-2019 Intel Corporation. All rights reserved.
Thank you.
Best
Christoph
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, indeed, this seems to be a problem with ifort, confirmed. Array bounds checking works with gfortran, NAG, and PGI.
ifort v18 also works, probably a regression.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At first glance, it does look like a bug in Intel Fortran compiler with -check:all option - I suggest submitting a support request.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, indeed, this seems to be a problem with ifort, confirmed. Array bounds checking works with gfortran, NAG, and PGI.
ifort v18 also works, probably a regression.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you. I will do that.
(They should have a link here to the bug report page or, even better, a button to directly file a bug report.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page