public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1577] [Ada] Look at Others_Discrete_Choices for N_Others_Choice
@ 2021-06-17 14:33 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-06-17 14:33 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:24c554da57b6aa81fb311556ed8ec1c609befd45

commit r12-1577-g24c554da57b6aa81fb311556ed8ec1c609befd45
Author: Richard Kenner <kenner@adacore.com>
Date:   Fri Mar 5 17:28:52 2021 -0500

    [Ada] Look at Others_Discrete_Choices for N_Others_Choice
    
    gcc/ada/
    
            * exp_util.adb (Expand_Static_Predicates_In_Choices): Handle
            Others_Discrete_Choices in N_Others_Choice.

Diff:
---
 gcc/ada/exp_util.adb | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 860525d12a1..c2cdb4cfdf4 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -5322,7 +5322,7 @@ package body Exp_Util is
    procedure Expand_Static_Predicates_In_Choices (N : Node_Id) is
       pragma Assert (Nkind (N) in N_Case_Statement_Alternative | N_Variant);
 
-      Choices : constant List_Id := Discrete_Choices (N);
+      Choices : List_Id := Discrete_Choices (N);
 
       Choice : Node_Id;
       Next_C : Node_Id;
@@ -5330,6 +5330,13 @@ package body Exp_Util is
       C      : Node_Id;
 
    begin
+      --  If this is an "others" alternative, we need to process any static
+      --  predicates in its Others_Discrete_Choices.
+
+      if Nkind (First (Choices)) = N_Others_Choice then
+         Choices := Others_Discrete_Choices (First (Choices));
+      end if;
+
       Choice := First (Choices);
       while Present (Choice) loop
          Next_C := Next (Choice);


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

only message in thread, other threads:[~2021-06-17 14:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 14:33 [gcc r12-1577] [Ada] Look at Others_Discrete_Choices for N_Others_Choice 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).