Hi all,
I have simplified a complex code to the following program and got the same unwanted behaviour. With compiler flag set to check bounds I got no runtime error where one should be:
program array_bounds_check ! implicit none ! ! --- locals integer,parameter :: column = 10, row = 20 real(kind(1.d0)), allocatable :: r1dummy_alloc(:) real(kind(1.d0)), allocatable :: r2dummy_alloc(:,:) real(kind(1.d0)) :: r1dummy_static(column) real(kind(1.d0)) :: r2dummy_static(column,row) ! ============================================================================== allocate(r1dummy_alloc(column)) allocate(r2dummy_alloc(column,row)) r1dummy_alloc = 0.d0 r2dummy_alloc = 0.d0 r1dummy_static = 0.d0 r2dummy_static = 0.d0 call random_number(r2dummy_alloc) r2dummy_static = r2dummy_alloc ! ! *** for allocated arrays ! this should produce a runtime array bounds error ! but this does show an error in ifort 12.1.6.369 !! r1dummy_alloc = maxval(r2dummy_alloc(1:column,1:row),dim=1) ! this should work -> and it does in ifort 12.1.6.369 r1dummy_alloc = maxval(r2dummy_alloc(1:column,1:row),dim=2) ! ! *** for static arrays ! this produces a compile array bounds error !r1dummy_static = maxval(r2dummy_static(1:column,1:row),dim=1) ! this should work -> and it does in ifort 12.1.6.369 r1dummy_static = maxval(r2dummy_static(1:column,1:row),dim=2) ! ------------------------------------------------------------------------------ deallocate(r1dummy_alloc) deallocate(r2dummy_alloc) end program array_bounds_check
ifort 12.1.6.369; compiler flags: /nologo /debug:full /Od /warn:declarations /warn:unused /warn:uncalled /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc100.pdb" /traceback /check:bounds /check:uninit /check:format /check:output_conversion /check:arg_temp_created /libs:static /threads /dbglibs /c
For static arrays a compile error occured where it should be. Should array bound checking for allocated arrays work with maxval/ maxloc, ... ? Have I coded the test program correct? Is it the same issue as in DPD200182047 (http://software.intel.com/en-us/forums/topic/278270 array bound checking for pointers) and is it solved in 13.1.119 ?
Kind regards,
Johannes




