diff options
author | Javier Miranda <miranda@adacore.com> | 2024-06-16 18:41:57 +0000 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-07-02 15:20:34 +0200 |
commit | 9fbf6517c73981c2050fe5b0260ca796217d43d5 (patch) | |
tree | 53f1bfbac32404c7e3abebd487ea2e632b5d8267 /gcc/dwarf2ctf.cc | |
parent | 29e10c52709504a5fb2d1e6b70e57a025636e200 (diff) | |
download | gcc-9fbf6517c73981c2050fe5b0260ca796217d43d5.zip gcc-9fbf6517c73981c2050fe5b0260ca796217d43d5.tar.gz gcc-9fbf6517c73981c2050fe5b0260ca796217d43d5.tar.bz2 |
ada: Miscomputed bounds for inner null array aggregates
When an array has several dimensions, and inner dimmensions are
initialized using Ada 2022 null array aggregates, the compiler
crashes or reports spurious errors computing the bounds of the
null array aggregates. This patch fixes the problem and adds
new warnings reported when the index of null array aggregates is
an enumeration type or a modular type and it is known at compile
time that the program will raise Constraint_Error computing the
bounds of the aggregate.
gcc/ada/
* sem_aggr.adb (Cannot_Compute_High_Bound): New subprogram.
(Report_Null_Array_Constraint_Error): New subprogram.
(Collect_Aggr_Bounds): For null aggregates, build the bounds
of the inner dimensions.
(Has_Null_Aggregate_Raising_Constraint_Error): New subprogram.
(Subtract): New subprogram.
(Resolve_Array_Aggregate): Report a warning when the index of
null array aggregates is an enumeration type or a modular type
at we can statically determine that the program will raise CE
at runtime computing its high bound.
(Resolve_Null_Array_Aggregate): ditto.
Diffstat (limited to 'gcc/dwarf2ctf.cc')
0 files changed, 0 insertions, 0 deletions