Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

bounds checking

Roman1
New Contributor I
695 Views

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


[fortran]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 [/fortran]
0 Kudos
6 Replies
Steven_L_Intel1
Employee
695 Views
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.
0 Kudos
Steven_L_Intel1
Employee
695 Views

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

0 Kudos
John_Campbell
New Contributor II
695 Views

Steve,

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

0 Kudos
Steven_L_Intel1
Employee
695 Views

Only if that were so....

0 Kudos
Roman1
New Contributor I
695 Views

 

Are you sure that this has been fixed?  I have just tried compiling with the latest compiler (16.0.1.146), 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

 

 

0 Kudos
Steven_L_Intel1
Employee
695 Views

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

0 Kudos
Reply