]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: improve bounds-checking for array sections [PR30802]
authorHarald Anlauf <anlauf@gmx.de>
Fri, 15 Sep 2023 17:13:38 +0000 (19:13 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Fri, 15 Sep 2023 17:13:38 +0000 (19:13 +0200)
commit1cbf18978aa384bd0ed2dc29b107fc3423cf8e62
treef90422ce7e613be7a4dfd27daa5313c208b252de
parentb975c0dc3be285655800180260c985bc97886f2e
Fortran: improve bounds-checking for array sections [PR30802]

gcc/fortran/ChangeLog:

PR fortran/30802
* trans-array.cc (trans_array_bound_check): Add optional argument
COMPNAME for explicit specification of array component name.
(array_bound_check_elemental): Helper function for generating
bounds-checking code for elemental dimensions.
(gfc_conv_expr_descriptor): Use bounds-checking also for elemental
dimensions, i.e. those not handled by the scalarizer.

gcc/testsuite/ChangeLog:

PR fortran/30802
* gfortran.dg/bounds_check_fail_6.f90: New test.
gcc/fortran/trans-array.cc
gcc/testsuite/gfortran.dg/bounds_check_fail_6.f90 [new file with mode: 0644]