Commit 7800a8fb by Yannick Moy Committed by Pierre-Marie de Rodat

[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
parent 1bb2e1d9
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> 2019-07-08 Ed Schonberg <schonberg@adacore.com>
* exp_ch9.adb (Expand_N_Timed_Entry_Call): Do not insert twice * exp_ch9.adb (Expand_N_Timed_Entry_Call): Do not insert twice
......
...@@ -112,7 +112,12 @@ package body Expander is ...@@ -112,7 +112,12 @@ package body Expander is
Expand_SPARK (N); Expand_SPARK (N);
end if; 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 -- Regular expansion is normally followed by special handling for
-- transient scopes for unconstrained results, etc. but this is not -- transient scopes for unconstrained results, etc. but this is not
......
...@@ -4611,10 +4611,14 @@ package body Sem_Eval is ...@@ -4611,10 +4611,14 @@ package body Sem_Eval is
-- will cause semantic errors if it is marked as static), and after -- will cause semantic errors if it is marked as static), and after
-- the Resolve step (since Resolve in some cases sets this flag). -- 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); Analyze (N);
Set_Is_Static_Expression (N, Static); Set_Is_Static_Expression (N, Static);
Set_Etype (N, Typ); Set_Etype (N, Typ);
Resolve (N); Resolve (N);
Set_Analyzed (N);
Set_Is_Static_Expression (N, Static); Set_Is_Static_Expression (N, Static);
end Fold_Ureal; end Fold_Ureal;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment