bounds checking

bounds checking

Roman's picture

Hi,

I am using Intel Fortran 12.1 update 8.

When I compile the following small program with all error checking enabled (/check:all),
the array bounds bug is not detected. Does the compiler check for bounds errors when
an array is accessed though a pointer? Would the new update 10 detect this errror?

Roman

program test_pointer_bounds
implicit none
integer,allocatable,target:: a(:)

integer,pointer:: pa(:)
allocate( a(3) )

a = 0
pa => a(3:4)  !!!

pa(2) = 1
write(*,*) a

stop

end program test_pointer_bounds

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Steve Lionel (Intel)'s picture

This is, in my view, a compiler bug. If it has not been previously reported, I will let the developers know. Issue ID is DPD200182047.

Steve

Login to leave a comment.