]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix compile time evaluation needed for static unfoldings
authorDenis Mazzucato <mazzucato@adacore.com>
Wed, 13 Aug 2025 15:14:35 +0000 (17:14 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 11 Sep 2025 09:10:46 +0000 (11:10 +0200)
Unfolding of static expressions is needed when evaluating static bounds, even in
the presence of strict analysis. Otherwise, we may wrongly identify static
predicates as dynamic ones, and thus require unnecessary "others" default case.

gcc/ada/ChangeLog:

* sem_attr.adb (Eval_Attribute): Remove strict analysis condition.

gcc/ada/sem_attr.adb

index 3a494ad940f6521e6c886039ec017c3b493fede2..2a92ffbce4f352e233cd8b6b8d85a8a67b6739df 100644 (file)
@@ -8195,13 +8195,6 @@ package body Sem_Attr is
 
       if Nkind (N) /= N_Attribute_Reference then
          return;
-
-      --  No evaluation required under strict preanalysis because locating
-      --  static expressions is not needed; this also minimizes making tree
-      --  modifications during strict preanalysis.
-
-      elsif In_Strict_Preanalysis then
-         return;
       end if;
 
       Aname := Attribute_Name (N);