[Ada] Expansion of discrete choices
authorHristian Kirtchev <kirtchev@adacore.com>
Thu, 24 May 2018 13:04:39 +0000 (13:04 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 24 May 2018 13:04:39 +0000 (13:04 +0000)
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.

2018-05-24  Hristian Kirtchev  <kirtchev@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.

From-SVN: r260646

gcc/ada/ChangeLog
gcc/ada/exp_util.adb

index c25e026..50c886d 100644 (file)
@@ -1,5 +1,11 @@
 2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
 
+       * 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.
+
+2018-05-24  Hristian Kirtchev  <kirtchev@adacore.com>
+
        * freeze.adb (Wrap_Imported_Subprogram): Generate an unchecked
        conversion to the return type to avoid a side effect where an imported
        relocated function generates a new anonymous access type, whose
index 5a8541d..2f3068d 100644 (file)
@@ -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;
 
    ------------------------------