[Ada] Fix compiler internal error
authorSteve Baird <baird@adacore.com>
Tue, 17 Aug 2021 17:01:11 +0000 (10:01 -0700)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 4 Oct 2021 08:45:03 +0000 (08:45 +0000)
gcc/ada/

* sem_util.adb (Is_Repeatedly_Evaluated): Handle the case of an
Old attribute reference that occurs within what was originally a
quantified expression but which expansion has transformed into
an Expression_With_Actions.

gcc/ada/sem_util.adb

index 0c0d34b..70ab0d6 100644 (file)
@@ -31510,7 +31510,12 @@ package body Sem_Util is
                   --    quantified_expression.
 
                   if Nkind (Par) = N_Quantified_Expression
-                     and then Trailer = Condition (Par)
+                    and then Trailer = Condition (Par)
+                  then
+                     return True;
+                  elsif Nkind (Par) = N_Expression_With_Actions
+                    and then
+                      Nkind (Original_Node (Par)) = N_Quantified_Expression
                   then
                      return True;
                   end if;