diff options
author | Marc Poulhiès <poulhies@adacore.com> | 2021-09-20 16:33:30 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-10-11 13:38:09 +0000 |
commit | 4dc82cc768d0f0bdf0ee6f5a3d53e3740ea890cf (patch) | |
tree | 402ca22b8dd3c676d26b794b057a1d5e9700aef3 /gcc/ada/expander.adb | |
parent | 6b1c091238aa00a25346266ae2aece880f749c3a (diff) | |
download | gcc-4dc82cc768d0f0bdf0ee6f5a3d53e3740ea890cf.zip gcc-4dc82cc768d0f0bdf0ee6f5a3d53e3740ea890cf.tar.gz gcc-4dc82cc768d0f0bdf0ee6f5a3d53e3740ea890cf.tar.bz2 |
[Ada] Do not clear Analyzed flag in expand if already set by preanalysis
gcc/ada/
* expander.adb (Expand): Skip clearing of Analyzed flag if
already set for N_Real_Literal.
Diffstat (limited to 'gcc/ada/expander.adb')
-rw-r--r-- | gcc/ada/expander.adb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ada/expander.adb b/gcc/ada/expander.adb index e0483b7..75c0edb 100644 --- a/gcc/ada/expander.adb +++ b/gcc/ada/expander.adb @@ -49,6 +49,7 @@ with Sem_Ch8; use Sem_Ch8; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; with Sinfo.Nodes; use Sinfo.Nodes; +with Stand; use Stand; with Table; package body Expander is @@ -152,7 +153,19 @@ package body Expander is -- not take place. This prevents cascaded errors due to stack mismatch. elsif not Expander_Active then - Set_Analyzed (N, Full_Analysis); + + -- Do not clear the Analyzed flag if it has been set on purpose + -- during preanalysis in Fold_Ureal. In that case, the Etype field + -- in N_Real_Literal will be set to something different than + -- Universal_Real. + + if Full_Analysis + or else not (Nkind (N) = N_Real_Literal + and then Present (Etype (N)) + and then Etype (N) /= Universal_Real) + then + Set_Analyzed (N, Full_Analysis); + end if; if Serious_Errors_Detected > 0 and then Scope_Is_Transient then Scope_Stack.Table |