From ebea257ee1195ce196ed005a7ee3a4b9e84117fb Mon Sep 17 00:00:00 2001 From: Hristian Kirtchev Date: Thu, 24 May 2018 13:04:39 +0000 Subject: [PATCH] [Ada] Expansion of discrete choices 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 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 | 6 ++++++ gcc/ada/exp_util.adb | 2 ++ 2 files changed, 8 insertions(+) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index c25e026..50c886d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,11 @@ 2018-05-24 Hristian Kirtchev + * 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 + * 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 diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 5a8541d..2f3068d 100644 --- a/gcc/ada/exp_util.adb +++ b/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; ------------------------------ -- 2.7.4