From f4ef7b06ce8973846a7002c9325c576e099917d6 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 20 Jan 2017 11:36:01 +0100 Subject: [multiple changes] 2017-01-20 Yannick Moy * inline.adb (Expand_Inlined_Call): Keep more precise type of actual for inlining whenever possible. In particular, do not switch to the formal type in GNATprove mode in some case where the GNAT backend might require it for visibility. 2017-01-20 Ed Schonberg * sem_ch3.adb (Check_Non_Overridable_Aspects): An inherited aspect Implicit_Dereference can be inherited by a full view if the partial view has no discriminants, because there is no way to apply the aspect to the partial view. (Build_Derived_Record_Type): If derived type renames discriminants of the parent, the new discriminant inherits the aspect from the old one. * sem_ch4.adb (Analyze_Call): Handle properly a parameterless call through an access discriminant designating a subprogram. * sem_ch5.adb (Analyze_Assignment): (Analyze_Call): Handle properly a parameterless call through an access discriminant on the left-hand side of an assignment. * sem_res.adb (resolve): If an interpreation involves a discriminant with an implicit dereference and the expression is an entity, resolution takes place later in the appropriate routine. * sem_ch13.adb (Analyze_Aspect_Implicit_Dereference): Recognize access discriminants that designate a subprogram type. 2017-01-20 Pascal Obry * a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016 From-SVN: r244698 --- gcc/ada/inline.adb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gcc/ada/inline.adb') diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 9fb47ef..f1afe32 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -3087,8 +3087,10 @@ package body Inline is elsif Base_Type (Etype (F)) = Base_Type (Etype (A)) and then Etype (F) /= Base_Type (Etype (F)) + and then Is_Constrained (Etype (F)) then Temp_Typ := Etype (F); + else Temp_Typ := Etype (A); end if; @@ -3150,7 +3152,15 @@ package body Inline is Subtype_Mark => New_Occurrence_Of (Etype (F), Loc), Expression => Relocate_Node (Expression (A))); - elsif Etype (F) /= Etype (A) then + -- In GNATprove mode, keep the most precise type of the actual + -- for the temporary variable. Otherwise, the AST may contain + -- unexpected assignment statements to a temporary variable of + -- unconstrained type renaming a local variable of constrained + -- type, which is not expected by GNATprove. + + elsif Etype (F) /= Etype (A) + and then not GNATprove_Mode + then New_A := Unchecked_Convert_To (Etype (F), Relocate_Node (A)); Temp_Typ := Etype (F); -- cgit v1.1