]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove useless subexpressions
authorRonan Desplanques <desplanques@adacore.com>
Fri, 9 May 2025 08:15:09 +0000 (10:15 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 1 Jul 2025 08:29:41 +0000 (10:29 +0200)
The subexpressions this patch removes were clearly useless given the
test for "No (Scheme)" in a preceding condition.

gcc/ada/ChangeLog:

* exp_ch5.adb (Expand_N_Loop_Statement): Remove useless subexpressions.

gcc/ada/exp_ch5.adb

index 3d8a542c24e0bdfcf8613e85de47b6fcd9e1234a..f1a7610bf28f3629e39a78ce962aca8628b8d784 100644 (file)
@@ -5980,8 +5980,7 @@ package body Exp_Ch5 is
       --       ...
       --    end loop
 
-      elsif Present (Scheme)
-        and then Present (Condition_Actions (Scheme))
+      elsif Present (Condition_Actions (Scheme))
         and then Present (Condition (Scheme))
       then
          declare
@@ -6013,9 +6012,7 @@ package body Exp_Ch5 is
 
       --  Here to deal with iterator case
 
-      elsif Present (Scheme)
-        and then Present (Iterator_Specification (Scheme))
-      then
+      elsif Present (Iterator_Specification (Scheme)) then
          Expand_Iterator_Loop (N);
 
          --  An iterator loop may generate renaming declarations for elements