diff options
author | Harald Anlauf <anlauf@gmx.de> | 2024-03-20 20:59:24 +0100 |
---|---|---|
committer | Harald Anlauf <anlauf@gmx.de> | 2024-03-21 18:56:06 +0100 |
commit | 509352069d6f166d396f4b4a86e71ea521f2ca78 (patch) | |
tree | fc9925d434bcd96676f3cb04592b0a9c87b7ae3c /libgcc | |
parent | 081f8937cb82da311c224da04b0c6cbd57a8fb5d (diff) | |
download | gcc-509352069d6f166d396f4b4a86e71ea521f2ca78.zip gcc-509352069d6f166d396f4b4a86e71ea521f2ca78.tar.gz gcc-509352069d6f166d396f4b4a86e71ea521f2ca78.tar.bz2 |
Fortran: improve array component description in runtime error message [PR30802]
Runtime error messages for array bounds violation shall use the following
scheme for a coherent, abridged description of arrays or array components
of derived types:
(1) If x is an ordinary array variable, use "x"
(2) if z is a DT scalar and x an array component at level 1, use "z%x"
(3) if z is a DT scalar and x an array component at level > 1, or
if z is a DT array and x an array (at any level), use "z...%x"
Use a new helper function abridged_ref_name for construction of that name.
gcc/fortran/ChangeLog:
PR fortran/30802
* trans-array.cc (abridged_ref_name): New helper function.
(trans_array_bound_check): Use it.
(array_bound_check_elemental): Likewise.
(gfc_conv_array_ref): Likewise.
gcc/testsuite/ChangeLog:
PR fortran/30802
* gfortran.dg/bounds_check_17.f90: Adjust pattern.
* gfortran.dg/bounds_check_fail_8.f90: New test.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions