bounds checking

bounds checking


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?


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


end program test_pointer_bounds

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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.

Retired 12/31/2016

Array bounds checking in pointer assignment has been implemented for a future (2016) major release.

Retired 12/31/2016


In 3 years, you haven't changed a bit !

Only if that were so....

Retired 12/31/2016


Are you sure that this has been fixed?  I have just tried compiling with the latest compiler (, and the bounds checking does not produce any errors.  I have all error checking enabled:

ifort /nologo /debug:full /Od /stand:f08 /warn:unused /warn:interfaces /Qtrapuv /Qinit:snan /Qinit:arrays /fpe:0 /Qfp-stack-check /module:"x64\Debug\\" /object:"x64\Debug\\" /Fd"x64\Debug\vc100.pdb" /traceback /check:all /libs:static /threads /dbglibs



I should have been clearer. I meant a major release scheduled for 2016, not the "2016" product. Sorry for the confusion.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today