From: Ed Schonberg Date: Mon, 28 May 2018 08:54:34 +0000 (+0000) Subject: [Ada] Don't create empty activation records X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f4bf7b62faf2fa3db8f1d79659c703d24fc6a555;p=gcc.git [Ada] Don't create empty activation records 2018-05-28 Ed Schonberg gcc/ada/ * exp_unst.adb (Unnest_Subprogram): Prevent creation of empty activation records. From-SVN: r260831 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d724ee9f933..8b0951c18a4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-05-28 Ed Schonberg + + * exp_unst.adb (Unnest_Subprogram): Prevent creation of empty + activation records. + 2018-05-28 Richard Kenner * exp_unst.adb (Check_Static_Type): Add argument to indicate node to be diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index fbc52b79f4a..e2ecafc331f 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -411,10 +411,13 @@ package body Exp_Unst is -- Entity name case. Make sure that the entity is declared -- in a subprogram. This may not be the case for for a type -- in a loop appearing in a precondition. + -- Exclude explicitly discriminants (that can appear + -- in bounds of discriminated components). if Is_Entity_Name (N) then if Present (Entity (N)) and then Present (Enclosing_Subprogram (Entity (N))) + and then Ekind (Entity (N)) /= E_Discriminant then Note_Uplevel_Ref (E => Entity (N),