diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2020-11-02 22:54:01 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-11-27 04:15:47 -0500 |
commit | 84c54629c2fb6dae0e7d97a2c57e894899f2b944 (patch) | |
tree | dde824100727d455c32afe4c3f0770b46f2b02ab /gcc/tree-ssa-loop-unswitch.c | |
parent | 2d1504186ee9d83fbc93f4b6880d55dcdd8daaff (diff) | |
download | gcc-84c54629c2fb6dae0e7d97a2c57e894899f2b944.zip gcc-84c54629c2fb6dae0e7d97a2c57e894899f2b944.tar.gz gcc-84c54629c2fb6dae0e7d97a2c57e894899f2b944.tar.bz2 |
[Ada] Optimize generation of checks for fixed-point types
gcc/ada/
* checks.ads (Determine_Range_To_Discrete): New procedure.
* checks.adb (Apply_Scalar_Range_Check): Call it to determine
a range for the expression when the target type is discrete.
And also apply the tests for discrete types to fixed-point
types when they are treated as integers.
(Apply_Type_Conversion_Checks): Apply checks to conversions
involving fixed-point types when they are treated as integers.
(Determine_Range) <N_Type_Conversion>: Factor out code into...
(Determine_Range_To_Discrete): ...this new procedure and add
support for fixed-point types when they are treated as integers.
* einfo.ads (Type_High_Bound): Remove obsolete sentence.
(Type_Low_Bound): Likewise.
* exp_ch4.adb (Discrete_Range_Check): Remove obsolete code.
(Real_Range_Check): Likewise.
(Expand_N_Type_Conversion): In case of a no-op conversion, clear
the Do_Range_Check flag on the operand before substituting it.
Remove calls to Real_Range_Check and Discrete_Range_Check that
are not guarded by the Do_Range_Check flag, and an assertion.
* sem_res.adb (Resolve_Type_Conversion): Always apply range
checks in GNATprove mode; in normal mode, use the updated type
of the operand in the test against Universal_Fixed. Remove
obsolete code setting the Do_Range_Check flag at the end.
Diffstat (limited to 'gcc/tree-ssa-loop-unswitch.c')
0 files changed, 0 insertions, 0 deletions