diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-10-24 19:20:30 +0200 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-11-12 14:00:50 +0100 |
commit | 3b78393b39a848dadfe6f7b703cda01b9870b6bd (patch) | |
tree | 3ac9ff161c781e83c630118a18384c63c1c7aae3 /gcc/ada/raise-gcc.c | |
parent | a45219815d17b050abc25a6348bfe7c981399363 (diff) | |
download | gcc-3b78393b39a848dadfe6f7b703cda01b9870b6bd.zip gcc-3b78393b39a848dadfe6f7b703cda01b9870b6bd.tar.gz gcc-3b78393b39a848dadfe6f7b703cda01b9870b6bd.tar.bz2 |
ada: Get rid of Kill_Range_Checks flag on entities
This flag is set in a single context, namely semantic analysis of record
type definitions, to avoid generating spurious range checks from it, and
a large testing campaign showed that, in practice, it makes a difference
in a single case, namely an access-to-constrained-array component with a
default expression, for example:
type Acc_String is access all String (1 .. 100);
type Rec (D : Positive) is record
A : Acc_String := new String (1 .. D);
end record;
Now there is another mechanism implemented in Process_Range_Expr_In_Decl to
avoid generating spurious range checks, which does not work in this specific
case but can be made to work with a small tweak to Denotes_Discriminant.
gcc/ada/ChangeLog:
* checks.adb (Range_Checks_Suppressed): Remove test on the
Kill_Range_Checks flag.
* einfo.ads (Kill_Range_Checks): Delete.
* gen_il-fields.ads (Opt_Field_Enum): Remove Kill_Range_Checks.
* gen_il-gen-gen_entities.adb (Entity_Kind): Likewise.
* sem_ch3.adb (Record_Type_Declaration): Do not set the
Kill_Range_Checks flag.
* sem_util.adb (Denotes_Discriminant): In a default expression,
also return True for a discriminal.
Diffstat (limited to 'gcc/ada/raise-gcc.c')
0 files changed, 0 insertions, 0 deletions