public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4292] [Ada] Do not clear Analyzed flag in expand if already set by preanalysis
@ 2021-10-11 13:39 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-10-11 13:39 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4dc82cc768d0f0bdf0ee6f5a3d53e3740ea890cf

commit r12-4292-g4dc82cc768d0f0bdf0ee6f5a3d53e3740ea890cf
Author: Marc Poulhiès <poulhies@adacore.com>
Date:   Mon Sep 20 16:33:30 2021 +0200

    [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.

Diff:
---
 gcc/ada/expander.adb | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/expander.adb b/gcc/ada/expander.adb
index e0483b7d029..75c0edb6333 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-11 13:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 13:39 [gcc r12-4292] [Ada] Do not clear Analyzed flag in expand if already set by preanalysis Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).