Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

-check-all issue

Christoph_F_
Beginner
523 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
523 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

4 Replies
FortranFan
Honored Contributor II
523 Views

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

Juergen_R_R
Valued Contributor I
524 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

Christoph_F_
Beginner
523 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.)

Steve_Lionel
Black Belt Retired Employee
523 Views

Screenshot_3.jpg

Reply