diff options
author | Yannick Moy <moy@adacore.com> | 2019-07-08 08:13:52 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-07-08 08:13:52 +0000 |
commit | 7800a8fb04adc60273185de201e9dff51b356952 (patch) | |
tree | 7a508b075f8729b84696d8be705686ce98e56116 | |
parent | 1bb2e1d96eb23d2289765cd0fd9ef10b7a3b7ea3 (diff) | |
download | gcc-7800a8fb04adc60273185de201e9dff51b356952.zip gcc-7800a8fb04adc60273185de201e9dff51b356952.tar.gz gcc-7800a8fb04adc60273185de201e9dff51b356952.tar.bz2 |
[Ada] Do not erase precise type on fixed-point real literal
Real literals of fixed-point type are expected to keep their precise
fixed-point type in GNATprove. This is now correctly enforced.
There is no impact on compilation.
2019-07-08 Yannick Moy <moy@adacore.com>
gcc/ada/
* expander.adb (Expand): Do not reset Analyzed flag always.
* sem_eval.adb (Fold_Ureal): Mark node as analyzed.
From-SVN: r273211
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/expander.adb | 7 | ||||
-rw-r--r-- | gcc/ada/sem_eval.adb | 4 |
3 files changed, 15 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1650732..e278295 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-07-08 Yannick Moy <moy@adacore.com> + + * expander.adb (Expand): Do not reset Analyzed flag always. + * sem_eval.adb (Fold_Ureal): Mark node as analyzed. + 2019-07-08 Ed Schonberg <schonberg@adacore.com> * exp_ch9.adb (Expand_N_Timed_Entry_Call): Do not insert twice diff --git a/gcc/ada/expander.adb b/gcc/ada/expander.adb index 11711b9..aac2e7d 100644 --- a/gcc/ada/expander.adb +++ b/gcc/ada/expander.adb @@ -112,7 +112,12 @@ package body Expander is Expand_SPARK (N); end if; - Set_Analyzed (N, Full_Analysis); + -- Do not reset the Analyzed flag if it has been set on purpose + -- during preanalysis. + + if Full_Analysis then + Set_Analyzed (N); + end if; -- Regular expansion is normally followed by special handling for -- transient scopes for unconstrained results, etc. but this is not diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb index 4956ef3..ff3359f 100644 --- a/gcc/ada/sem_eval.adb +++ b/gcc/ada/sem_eval.adb @@ -4611,10 +4611,14 @@ package body Sem_Eval is -- will cause semantic errors if it is marked as static), and after -- the Resolve step (since Resolve in some cases sets this flag). + -- We mark the node as analyzed so that its type is not erased by + -- calling Analyze_Real_Literal. + Analyze (N); Set_Is_Static_Expression (N, Static); Set_Etype (N, Typ); Resolve (N); + Set_Analyzed (N); Set_Is_Static_Expression (N, Static); end Fold_Ureal; |