]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix detection of if_expressions that are known on entry
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 22 Feb 2024 21:25:16 +0000 (22:25 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 16 May 2024 08:49:30 +0000 (10:49 +0200)
Fix a small glitch in routine Is_Known_On_Entry, which returned False
for all if_expressions, regardless whether their conditions or dependent
expressions are known on entry.

gcc/ada/

* sem_util.adb (Is_Known_On_Entry): Check whether condition and
dependent expressions of an if_expression are known on entry.

gcc/ada/sem_util.adb

index 68e131db60625e973647fb6891e85e9c76143bd8..766cabfc109da1f8b19cb8022c0ddaa4830296cf 100644 (file)
@@ -30784,9 +30784,7 @@ package body Sem_Util is
                   return Is_Known_On_Entry (Expression (Expr));
 
                when N_If_Expression =>
-                  if not All_Exps_Known_On_Entry (Expressions (Expr)) then
-                     return False;
-                  end if;
+                  return All_Exps_Known_On_Entry (Expressions (Expr));
 
                when N_Case_Expression =>
                   if not Is_Known_On_Entry (Expression (Expr)) then