Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

-check-all issue

Christoph_F_
Beginner
1,804 Views

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

 

0 Kudos
1 Solution
Juergen_R_R
Valued Contributor I
1,804 Views

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.

View solution in original post

0 Kudos
4 Replies
FortranFan
Honored Contributor II
1,804 Views

At first glance, it does look like a bug in Intel Fortran compiler with -check:all option - I suggest submitting a support request.

0 Kudos
Juergen_R_R
Valued Contributor I
1,805 Views

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.

0 Kudos
Christoph_F_
Beginner
1,804 Views

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.)

0 Kudos
Steve_Lionel
Honored Contributor III
1,804 Views

Screenshot_3.jpg

0 Kudos
Reply