diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-20 11:36:01 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-20 11:36:01 +0100 |
commit | f4ef7b06ce8973846a7002c9325c576e099917d6 (patch) | |
tree | de0d3712f5e7b370de37a74832eae8ddd864b39f /gcc/ada/inline.adb | |
parent | 8f1fe1f8cee02a23f50c17550032120a157d974b (diff) | |
download | gcc-f4ef7b06ce8973846a7002c9325c576e099917d6.zip gcc-f4ef7b06ce8973846a7002c9325c576e099917d6.tar.gz gcc-f4ef7b06ce8973846a7002c9325c576e099917d6.tar.bz2 |
[multiple changes]
2017-01-20 Yannick Moy <moy@adacore.com>
* 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 <schonberg@adacore.com>
* 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 <obry@adacore.com>
* a-locale.adb, a-locale.ads: Update Ada.Locales for RM 2012 COR:1:2016
From-SVN: r244698
Diffstat (limited to 'gcc/ada/inline.adb')
-rw-r--r-- | gcc/ada/inline.adb | 12 |
1 files changed, 11 insertions, 1 deletions
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); |