diff options
author | Marc Poulhiès <poulhies@adacore.com> | 2022-03-18 10:32:41 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-05-18 08:41:03 +0000 |
commit | 8e4f37024ada46dafe1f8fd8464f0be118c6b961 (patch) | |
tree | 16d16460a7c85eca57c218cf6757b5eb959592e6 /gcc/multiple_target.cc | |
parent | de02cb5d72cfbac5a7a5537c5bf85c11f716f806 (diff) | |
download | gcc-8e4f37024ada46dafe1f8fd8464f0be118c6b961.tar.gz |
[Ada] Rework optimization skipping pragma check in object declaration
When an object declaration is initialized with a type conversion:
Var : Typ := Typ (Value);
we skip the check for Typ's predicate as it is already checked
during the type conversion.
This is not correct when Var's subtype and the target subtype of the
conversion do not statically match:
Var : Typ := OtherTyp (Value);
In such case, we can't skip the check of Typ's predicate.
Fix minor typos in comment.
gcc/ada/
* sem_ch3.adb (Analyze_Object_Declaration): Skip predicate check
for type conversion if object's subtype and expression's subtype
statically match.
* exp_prag.adb (Expand_Pragma_Check): Typo fix in comment.
Diffstat (limited to 'gcc/multiple_target.cc')
0 files changed, 0 insertions, 0 deletions