From: Arnaud Charlet Date: Wed, 3 Aug 2011 08:11:09 +0000 (+0200) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4317e442b4eced893bf40c552deb37c303d81102;p=gcc.git [multiple changes] 2011-08-03 Robert Dewar * exp_ch5.adb, sem_prag.adb, exp_ch4.adb: Minor reformatting. 2011-08-03 Ed Schonberg * sem_ch3.adb (Build_Itype_Reference): do not create an itype reference for an itype created within a generic unit. 2011-08-03 Eric Botcazou * gnat_ugn.texi (Switches for gcc): Make it clearer that -fno-inline suppresses all inlining. From-SVN: r177238 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 251718fc136..85d42bdb2ea 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,17 @@ +2011-08-03 Robert Dewar + + * exp_ch5.adb, sem_prag.adb, exp_ch4.adb: Minor reformatting. + +2011-08-03 Ed Schonberg + + * sem_ch3.adb (Build_Itype_Reference): do not create an itype reference + for an itype created within a generic unit. + +2011-08-03 Eric Botcazou + + * gnat_ugn.texi (Switches for gcc): Make it clearer that -fno-inline + suppresses all inlining. + 2011-08-03 Robert Dewar * sem_ch3.adb, sem_res.adb, exp_ch13.adb, exp_disp.adb, diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 203795015c3..27e6279764e 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -7596,15 +7596,13 @@ package body Exp_Ch4 is function Is_Subtype_Declaration return Boolean; -- The replacement of a discriminant reference by its value is required - -- if this is part of the initialization of an temporary generated by - -- a change of representation. This shows up as the construction of a + -- if this is part of the initialization of an temporary generated by a + -- change of representation. This shows up as the construction of a -- discriminant constraint for a subtype declared at the same point as - -- the entity in the prefix of the selected component. - -- We recognize this case when the context of the reference is: - -- - -- subtype ST is T(Obj.D); - -- - -- The entity for Obj comes from source, and ST has the same sloc. + -- the entity in the prefix of the selected component. We recognize this + -- case when the context of the reference is: + -- subtype ST is T(Obj.D); + -- where the entity for Obj comes from source, and ST has the same sloc. ----------------------- -- In_Left_Hand_Side -- @@ -7625,7 +7623,6 @@ package body Exp_Ch4 is function Is_Subtype_Declaration return Boolean is Par : constant Node_Id := Parent (N); - begin return Nkind (Par) = N_Index_Or_Discriminant_Constraint @@ -7767,9 +7764,9 @@ package body Exp_Ch4 is if Disc = Entity (Selector_Name (N)) and then (Is_Entity_Name (Dval) - or else Nkind (Dval) = N_Integer_Literal - or else Is_Subtype_Declaration - or else Is_Static_Expression (Dval)) + or else Nkind (Dval) = N_Integer_Literal + or else Is_Subtype_Declaration + or else Is_Static_Expression (Dval)) then -- Here we have the matching discriminant. Check for -- the case of a discriminant of a component that is diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index dad94273afb..51ae183bc35 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -1934,13 +1934,13 @@ package body Exp_Ch5 is -- If the type is tagged, we may as well use the predefined -- primitive assignment. This avoids inlining a lot of code - -- and in the class-wide case, the assignment is replaced by a - -- dispatching call to _assign. It is suppressed in the case of - -- assignments created by the expander that correspond to - -- initializations, where we do want to copy the tag - -- (Expand_Ctrl_Actions flag is set True in this case). - -- It is also suppressed if restriction No_Dispatching_Calls is - -- in force because in that case predefined primitives are not + -- and in the class-wide case, the assignment is replaced + -- by a dispatching call to _assign. It is suppressed in the + -- case of assignments created by the expander that correspond + -- to initializations, where we do want to copy the tag + -- (Expand_Ctrl_Actions flag is set True in this case). It is + -- also suppressed if restriction No_Dispatching_Calls is in + -- force because in that case predefined primitives are not -- generated. or else (Is_Tagged_Type (Typ) diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index ba83f787f5d..dd90a835fea 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -3961,10 +3961,9 @@ and @command{gcc} cannot be used to run the GNAT binder. @item -fno-inline @cindex @option{-fno-inline} (@command{gcc}) -Suppresses all back-end inlining, even if other optimization or inlining -switches are set. -This includes suppression of inlining that results -from the use of the pragma @code{Inline_Always}. +Suppresses all inlining, even if other optimization or inlining +switches are set. This includes suppression of inlining that +results from the use of the pragma @code{Inline_Always}. Any occurrences of pragma @code{Inline} or @code{Inline_Always} are ignored, and @option{-gnatn} and @option{-gnatN} have no effect if this switch is present. diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 5de3b0ece70..aa6f6b249f8 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -8631,8 +8631,15 @@ package body Sem_Ch3 is is IR : constant Node_Id := Make_Itype_Reference (Sloc (Nod)); begin - Set_Itype (IR, Ityp); - Insert_After (Nod, IR); + + -- Itype references are only created for use by the back-end. + + if Inside_A_Generic then + return; + else + Set_Itype (IR, Ityp); + Insert_After (Nod, IR); + end if; end Build_Itype_Reference; ------------------------ diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 4cab6b4f429..4d6a55ca408 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -4729,7 +4729,6 @@ package body Sem_Prag is if Is_Generic_Instance (Subprogram_Def) then Set_Encoded_Interface_Name (Alias (Get_Base_Subprogram (Subprogram_Def)), Link_Nam); - else Set_Encoded_Interface_Name (Get_Base_Subprogram (Subprogram_Def), Link_Nam);