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

LBOUND intrinsic for assumed rank

Harald1
Novice
574 Views

Hello,

I thought this had been fixed long time ago (for Intel v16), but the following testcase looks inconsistent:

program p
  implicit none
  integer, pointer     :: x(:,:)
  allocate (x(-3:3,4:0))
  print *, "lbound =", lbound (x)
  call sub1 (x)
  call sub2 (x)
contains
  subroutine sub1 (y)
    integer, pointer     :: y(:,:)
    print *, "lbound =", lbound (y)
  end
  subroutine sub2 (y)
    integer, pointer     :: y(..)
    print *, "lbound =", lbound (y)
  end
end

 With

Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.3.0 Build 20210609_000000

I get:

lbound = -3 1
lbound = -3 1
lbound = -3 4

Why does assumed rank differ here for the second dimension (which has extent zero)?

Thanks,

Harald

 

0 Kudos
1 Solution
Barbara_P_Intel
Moderator
421 Views

Yes, this looks like a regression. It works as you expect with 19.1.4, but not with 2021.1.1 or 2021.4.0. I filed a bug, CMPLRIL0-34270. I'll let you know when it's fixed.



View solution in original post

4 Replies
Harald1
Novice
459 Views

Fortran 2018, 16.9.109 LBOUND: careful reading of the paragraph on the result value would require for sub2 to print the same as sub1.  Thus the handling of assumed-rank would need to be changed.

 

Barbara_P_Intel
Moderator
422 Views

Yes, this looks like a regression. It works as you expect with 19.1.4, but not with 2021.1.1 or 2021.4.0. I filed a bug, CMPLRIL0-34270. I'll let you know when it's fixed.



Barbara_P_Intel
Moderator
144 Views

This issue you reported is fixed in the latest version of ifort, 2021.6.0. It's part of oneAPI HPC Toolkit 2022.2 that was recently released.



Harald1
Novice
123 Views

I can confirm that the issue is fixed.

Thanks,

Harald

 

Reply