This patch does some minor bookkeeping to avoid a potential double expansion
of discrete choices where at least one of them is a subtype with predicates.
No change in behavior, no need for a test.

Tested on x86_64-pc-linux-gnu, committed on trunk

2018-05-24  Hristian Kirtchev  <kirtc...@adacore.com>

gcc/ada/

        * exp_util.adb (Expand_Static_Predicates_In_Choices): Indicate that the
        construct with discrete choices no longer contains a subtype with
        predicates since the expansion already handled this case.
--- gcc/ada/exp_util.adb
+++ gcc/ada/exp_util.adb
@@ -4995,6 +4995,8 @@ package body Exp_Util is
 
          Choice := Next_C;
       end loop;
+
+      Set_Has_SP_Choice (N, False);
    end Expand_Static_Predicates_In_Choices;
 
    ------------------------------

Reply via email to