public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-645] [Ada] Cleanup expansion of protected entry families
@ 2022-05-19 14:07 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-19 14:07 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b626498f6e444ac40eab1a8eaeb843e743028b13

commit r13-645-gb626498f6e444ac40eab1a8eaeb843e743028b13
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Tue Apr 12 21:46:36 2022 +0200

    [Ada] Cleanup expansion of protected entry families
    
    Expansion of entry families contained a condition that was always true.
    Cleanup related to detection of uninitialized scalar objects (which
    uncovered that expansion of entry families creates a slightly illegal
    AST with Elsif_Parts being an empty list).
    
    gcc/ada/
    
            * exp_ch9.adb (Build_Find_Body_Index): Remove IF statement whose
            condition was true-by-construction; remove excessive assertion
            (since the call to Elsif_Parts will check that Nod is present
            and it is an if-statement).

Diff:
---
 gcc/ada/exp_ch9.adb | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 0e551ab868c..f9bdaf80c94 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -2793,20 +2793,14 @@ package body Exp_Ch9 is
                 Expression => Make_Integer_Literal (Loc, 1));
 
          else
-            pragma Assert (Present (Ret));
+            --  Ranges are in increasing order, so last one doesn't need guard
 
-            if Nkind (Ret) = N_If_Statement then
-
-               --  Ranges are in increasing order, so last one doesn't need
-               --  guard.
-
-               declare
-                  Nod : constant Node_Id := Last (Elsif_Parts (Ret));
-               begin
-                  Remove (Nod);
-                  Set_Else_Statements (Ret, Then_Statements (Nod));
-               end;
-            end if;
+            declare
+               Nod : constant Node_Id := Last (Elsif_Parts (Ret));
+            begin
+               Remove (Nod);
+               Set_Else_Statements (Ret, Then_Statements (Nod));
+            end;
          end if;
       end if;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-19 14:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19 14:07 [gcc r13-645] [Ada] Cleanup expansion of protected entry families Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).