Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Ankündigungen
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Pointer assignment ot of bounds

albert
Einsteiger
461Aufrufe
Dear all,

When running the example below (compiled with the -check all) I would have expected to get a runtime error because of the out of bounds assignment. This does not happen. How can I get this error or is this a bug in the compiler (I use 9.1 but it is also present in 10.1).

Best regards,

Albert

PROGRAM tst
DOUBLE PRECISION, POINTER :: a(:)
DOUBLE PRECISION, POINTER :: b(:)
DOUBLE PRECISION, POINTER :: c(:)
DOUBLE PRECISION, POINTER :: e(:)
INTEGER:: i

allocate(a(10000))
allocate(b(10000))
allocate(c(10000))

e => b(15000:15000)
  ;
do i = 1,1
e(i) = i
enddo
write(*,*) sum(a), sum(b), sum(c), sum(e)
end PROGRAM

0 Kudos
2 Antworten
Steven_L_Intel1
Mitarbeiter
461Aufrufe
Albert,

Our compiler does not currently notice the problem with the pointer assignment - that's where it would have to catch this. Our normal bounds checking looks only at array (and string) references, and the references within the loop of E are all within the bounds of E. That E points to invalid storage is a separate issue.

I will pass your comments on to the developers as a feature request.
albert
Einsteiger
461Aufrufe
MADsblionel:

I will pass your comments on to the developers as a feature request.


Much appreciated,

Albert
Antworten