https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30802
--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Harald Anlauf <anl...@gcc.gnu.org>: https://gcc.gnu.org/g:1cbf18978aa384bd0ed2dc29b107fc3423cf8e62 commit r14-4039-g1cbf18978aa384bd0ed2dc29b107fc3423cf8e62 Author: Harald Anlauf <anl...@gmx.de> Date: Fri Sep 15 19:13:38 2023 +0200 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.