This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran,commited] Don't perform bounds-checking on assumed-size arrays


This doesn't do any bounds checking at all for an assumed-size array, however, while all but the last exponent of an assumed-size array should in theory be checkable. Would making the check

      if (flag_bounds_check && (ar->as->type != AS_ASSUMED_SIZE
        || n < ar->dimen - 1))

work correctly for checking the lower dimensions?

I just commited the following fix, just as you proposed:


PR fortran/19777
* trans-array.c (gfc_conv_array_ref): Perform out-of-bounds
checking for assumed-size arrrays for all but the last dimension.
* gfortran.dg/bounds_check_2.f: Add new check for multidimensional
arrays.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]