[COMMITTED,22/26] ada: Refactor negated conjuncts

Message ID 20240802071210.413366-22-poulhies@adacore.com
State Committed
Commit 72ae355328fe30d61227501be4314689295a03f1
Headers
Series [COMMITTED,01/26] ada: Fix detection of suspicious loop patterns |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply

Commit Message

Marc Poulhiès Aug. 2, 2024, 7:11 a.m. UTC
  From: Piotr Trojanek <trojanek@adacore.com>

Code cleanup; semantics is unaffected.

gcc/ada/

	* exp_util.adb (Insert_Actions): Move negation in front of
	complex conjunctions.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/exp_util.adb | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
  

Patch

diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index bd8bbb39d9c..bde50687597 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -8146,12 +8146,13 @@  package body Exp_Util is
                  --  not already set can lead to gigi assertion failures that
                  --  are presumably due to malformed trees, so don't do that.
 
-                 and then (Nkind (P) /= N_Iterated_Component_Association
-                            or else not Is_List_Member (N)
-                            or else
-                              List_Containing (N) /= Discrete_Choices (P))
-                 and then (Nkind (P) /= N_Component_Association
-                            or else Present (Loop_Actions (P)))
+                 and then
+                   not (Nkind (P) = N_Iterated_Component_Association
+                          and then Is_List_Member (N)
+                          and then List_Containing (N) = Discrete_Choices (P))
+                 and then
+                   not (Nkind (P) = N_Component_Association
+                          and then No (Loop_Actions (P)))
                then
                   if Is_Empty_List (Loop_Actions (P)) then
                      Set_Loop_Actions (P, Ins_Actions);