https://gcc.gnu.org/g:70faad19613748c7894afafac2703d7aa856a7c6

commit r15-5404-g70faad19613748c7894afafac2703d7aa856a7c6
Author: Eric Botcazou <ebotca...@adacore.com>
Date:   Fri Nov 8 15:35:27 2024 +0100

    ada: Fix small oversight in removal of N_Unchecked_Expression node
    
    In addition to Resolve_Indexed_Component, Eval_Indexed_Component can also
    set the Do_Range_Check flag on the expressions of an N_Indexed_Component
    node through the call on Check_Non_Static_Context, so this also needs to
    be blocked by the Kill_Range_Check flag.
    
    gcc/ada/ChangeLog:
    
            * sem_eval.adb (Eval_Indexed_Component): Clear Do_Range_Check on
            the expressions if Kill_Range_Check is set on the node.

Diff:
---
 gcc/ada/sem_eval.adb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index a880acabad87..9ea042ba0d33 100644
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -2629,6 +2629,9 @@ package body Sem_Eval is
       Expr := First (Expressions (N));
       while Present (Expr) loop
          Check_Non_Static_Context (Expr);
+         if Kill_Range_Check (N) then
+            Set_Do_Range_Check (Expr, False);
+         end if;
          Next (Expr);
       end loop;

Reply via email to