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!
26750 Discussions

Incorrect (or strange) reporting of array shape checking option when pointer lbound remapping is used.

artu72
Beginner
187 Views

In the release 2019 of Intel Fortran compiler there is now the new option of array shape checking, as reported here:

https://software.intel.com/en-us/articles/array-shape-check-new-in-intel-fortran-compiler-190

Now, in the following code

program intele33

implicit none

integer, dimension(8,2), target :: i
integer, dimension(:), pointer :: j

j(1:) => i(:,2)

end program

while running I obtain the following warning (compiled with check all option):

forrtl: warning (406): fort: (33): Shape mismatch: The extent of dimension 1 of array J is 0 and the corresponding extent of array I is 8

but the resulting code is however perfectly working. gfortran does not issue this warning.
 

If I remove the lbound remapping

j => i(:,2)

there is no warning/error.

This is strange, since in both cases the pointer i has lower bound 1.

0 Kudos
4 Replies
Juergen_R_R
Valued Contributor I
187 Views

I do not get any warning with the 19.0 release version neither for -check shape nor with -check all.

 

artu72
Beginner
187 Views

I removed this post since I ahve updated the first post and topic with a more precise description of the issue.

artu72
Beginner
187 Views

Juergen R. wrote:

I do not get any warning with the 19.0 release version neither for -check shape nor with -check all.

I have updated the issue description, please read it. Thank you.

Juergen_R_R
Valued Contributor I
187 Views

Ok, I overlooked that it is a runtime error message. This indeed looks like a compiler bug to me.

Reply