diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-02-20 10:53:22 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-02-20 10:53:22 +0100 |
commit | 09edc2c2bbca4e668222ec0ffdae15f051cf8ea1 (patch) | |
tree | 09db00ead348c3392e60bb057f44aeab61757db6 /gcc | |
parent | 22efcab77ad9a19cae5e828a9bcfd4dba9ea02ec (diff) | |
download | gcc-09edc2c2bbca4e668222ec0ffdae15f051cf8ea1.zip gcc-09edc2c2bbca4e668222ec0ffdae15f051cf8ea1.tar.gz gcc-09edc2c2bbca4e668222ec0ffdae15f051cf8ea1.tar.bz2 |
[multiple changes]
2015-02-20 Eric Botcazou <ebotcazou@adacore.com>
* inline.adb (Expand_Inlined_Call): Skip again calls to subprogram
renamings.
* exp_ch6.adb (Expand_Call): Use back-end inlining
instead of expansion for simple subprogram renamings.
2015-02-20 Robert Dewar <dewar@adacore.com>
* exp_util.adb: Minor reformatting.
From-SVN: r220844
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/ada/exp_ch6.adb | 9 | ||||
-rw-r--r-- | gcc/ada/exp_util.adb | 5 | ||||
-rw-r--r-- | gcc/ada/inline.adb | 7 |
4 files changed, 24 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 72d2a65..e50d195 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2015-02-20 Eric Botcazou <ebotcazou@adacore.com> + + * inline.adb (Expand_Inlined_Call): Skip again calls to subprogram + renamings. + * exp_ch6.adb (Expand_Call): Use back-end inlining + instead of expansion for simple subprogram renamings. + +2015-02-20 Robert Dewar <dewar@adacore.com> + + * exp_util.adb: Minor reformatting. + 2015-02-20 Vincent Celier <celier@adacore.com> * switch-c.adb (Scan_Front_End_Switches): Do not fail when --RTS= diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 870e5f8..8b2278f 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -3778,12 +3778,17 @@ package body Exp_Ch6 is or else Nkind (Unit_Declaration_Node (Subp)) /= N_Subprogram_Declaration or else No (Body_To_Inline (Unit_Declaration_Node (Subp))) + or else Nkind (Body_To_Inline (Unit_Declaration_Node (Subp))) in + N_Entity then Add_Inlined_Body (Subp, Call_Node); -- Front end expansion of simple functions returning unconstrained - -- types (see Check_And_Split_Unconstrained_Function) and simple - -- renamings inlined by the front end (see Build_Renamed_Body). + -- types (see Check_And_Split_Unconstrained_Function). Note that the + -- case of a simple renaming (Body_To_Inline in N_Entity above, see + -- also Build_Renamed_Body) cannot be expanded here because this may + -- give rise to order-of-elaboration issues for the types of the + -- parameters of the subprogram, if any. else Expand_Inlined_Call (Call_Node, Subp, Orig_Subp); diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index ef463c2..aa835ad 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -7315,8 +7315,9 @@ package body Exp_Util is (Loc : Source_Ptr; Id : Character; Related_Nod : Node_Id := Empty) return Entity_Id; - -- Create an external symbol of the form xxx_FIRST/_LAST if Related_Id - -- is present, otherwise it generates an internal temporary. + -- Create an external symbol of the form xxx_FIRST/_LAST if Related_Nod + -- is present (xxx is taken from the Chars field of Related_Nod), + -- otherwise it generates an internal temporary. --------------------- -- Build_Temporary -- diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index 74b3971..9a60bef 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -2694,12 +2694,11 @@ package body Inline is return; -- Skip inlining if this is not a true inlining since the attribute - -- Body_To_Inline is also set for renamings (see sinfo.ads) + -- Body_To_Inline is also set for renamings (see sinfo.ads). For a + -- true inlining, Orig_Bod has code rather than being an entity. elsif Nkind (Orig_Bod) in N_Entity then - if not Has_Pragma_Inline (Subp) then - return; - end if; + return; -- Skip inlining if the function returns an unconstrained type using -- an extended return statement since this part of the new inlining |