]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 4 Aug 2014 10:41:40 +0000 (12:41 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 4 Aug 2014 10:41:40 +0000 (12:41 +0200)
2014-08-04  Robert Dewar  <dewar@adacore.com>

* sem_ch3.adb, einfo.ads: Minor reformatting.

2014-08-04  Yannick Moy  <moy@adacore.com>

* inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Fix
detection of subprograms that cannot be inlined in GNATprove mode.

2014-08-04  Ed Schonberg  <schonberg@adacore.com>

* einfo.adb: Add guard to Returns_Limited_View.

2014-08-04  Jose Ruiz  <ruiz@adacore.com>

* s-tassta.adb, s-tarest.adb (Task_Wrapper): Force maximum alignment of
the secondary stack to respect the alignments of the returned objects.

From-SVN: r213565

gcc/ada/ChangeLog
gcc/ada/einfo.adb
gcc/ada/einfo.ads
gcc/ada/inline.adb
gcc/ada/s-tarest.adb
gcc/ada/s-tassta.adb
gcc/ada/sem_ch3.adb

index c45e77a9972263db2ba0d436bcc63e576c24cd70..26d63fad439e58379b849d5548ddb5fe812ae335 100644 (file)
@@ -1,3 +1,21 @@
+2014-08-04  Robert Dewar  <dewar@adacore.com>
+
+       * sem_ch3.adb, einfo.ads: Minor reformatting.
+
+2014-08-04  Yannick Moy  <moy@adacore.com>
+
+       * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Fix
+       detection of subprograms that cannot be inlined in GNATprove mode.
+
+2014-08-04  Ed Schonberg  <schonberg@adacore.com>
+
+       * einfo.adb: Add guard to Returns_Limited_View.
+
+2014-08-04  Jose Ruiz  <ruiz@adacore.com>
+
+       * s-tassta.adb, s-tarest.adb (Task_Wrapper): Force maximum alignment of
+       the secondary stack to respect the alignments of the returned objects.
+
 2014-08-04  Ed Schonberg  <schonberg@adacore.com>
 
        * einfo.ads, einfo.adb (Returns_Limited_View): New flag defined
index f3899a93bb71c9583fe57ece5dd3a539a420077c..d4a5260541ec0a3a1f970ca9b9abf788ad7aaa90 100644 (file)
@@ -2872,6 +2872,7 @@ package body Einfo is
 
    function Returns_Limited_View (Id : E) return B is
    begin
+      pragma Assert (Ekind (Id) = E_Function);
       return Flag134 (Id);
    end Returns_Limited_View;
 
@@ -5701,6 +5702,7 @@ package body Einfo is
 
    procedure Set_Returns_Limited_View (Id : E; V : B := True) is
    begin
+      pragma Assert (Ekind (Id) = E_Function);
       Set_Flag134 (Id, V);
    end Set_Returns_Limited_View;
 
index 14bb0d0d28ebf2aab859f56b1df03dc58b549c0e..491e84dd4b372dd387a7a357659ec875dcd50943 100644 (file)
@@ -3767,15 +3767,15 @@ package Einfo is
 --       even though it causes the whole function to return.
 
 --    Returns_By_Ref (Flag90)
---       Defined in function entities, to indicate that the function
---       returns the result by reference, either because its return type is a
---       by-reference-type or because it uses explicitly the secondary stack.
+--       Defined in function entities. Set if the function returns the result
+--       by reference, either because its return type is a by-reference-type
+--       or because the function explicitly uses the secondary stack.
 
 --    Returns_Limited_View (Flag134)
---       Defined on function entities, to indicate that the return type of
---       the function at the point of definition is a limited view. Used to
---       handle the late freezing of the function, when it is called in the
---       current semantic unit while it is still unfrozen.
+--       Defined in function entities. Set if the return type of the function
+--       at the point of definition is a limited view. Used to handle the late
+--       freezing of the function when it is called in the current semantic
+--       unit while it is still unfrozen.
 
 --    Reverse_Bit_Order (Flag164) [base type only]
 --       Defined in all record type entities. Set if entity has a Bit_Order
index 7a3b2a706b66ad4a5cda5d3146b82c124594bcb4..022bc7656a86a3727815ed4ed39b7e30a871e773 100644 (file)
@@ -1382,6 +1382,9 @@ package body Inline is
       --  Returns True if subprogram Id has any contract (Pre, Post, Global,
       --  Depends, etc.)
 
+      function Is_Unit_Subprogram (Id : Entity_Id) return Boolean;
+      --  Returns True if subprogram Id defines a compilation unit
+
       function In_Package_Visible_Spec (Id : Node_Id) return Boolean;
       --  Returns True if subprogram Id is defined in the visible part of a
       --  package specification.
@@ -1436,6 +1439,20 @@ package body Inline is
          return Nkind (Original_Node (Decl)) = N_Expression_Function;
       end Is_Expression_Function;
 
+      ------------------------
+      -- Is_Unit_Subprogram --
+      ------------------------
+
+      function Is_Unit_Subprogram (Id : Entity_Id) return Boolean is
+         Decl : Node_Id := Parent (Parent (Id));
+      begin
+         if Nkind (Parent (Id)) = N_Defining_Program_Unit_Name then
+            Decl := Parent (Decl);
+         end if;
+
+         return Nkind (Parent (Decl)) = N_Compilation_Unit;
+      end Is_Unit_Subprogram;
+
       --  Local declarations
 
       Id : Entity_Id;  --  Procedure or function entity for the subprogram
@@ -1462,7 +1479,7 @@ package body Inline is
 
       --  Do not inline unit-level subprograms
 
-      if Nkind (Parent (Id)) = N_Defining_Program_Unit_Name then
+      if Is_Unit_Subprogram (Id) then
          return False;
 
       --  Do not inline subprograms declared in the visible part of a package
index c746ab9e17c57f7be4a3e285d84763860a2a7c34..d8478fa7b7a523ca4735f0f4a8450ab82a907fea 100644 (file)
@@ -210,6 +210,7 @@ package body System.Tasking.Restricted.Stages is
       Secondary_Stack : aliased SSE.Storage_Array
         (1 .. Self_ID.Common.Compiler_Data.Pri_Stack_Info.Size *
                 SSE.Storage_Offset (Parameters.Sec_Stack_Percentage) / 100);
+      for Secondary_Stack'Alignment use Standard'Maximum_Alignment;
 
       pragma Warnings (Off);
       Secondary_Stack_Address : System.Address := Secondary_Stack'Address;
index 1cf83dad09900ed438a07ef1957738221151f0d2..971879c5f23f0be8855b549a2a29fccf43dee319 100644 (file)
@@ -1052,6 +1052,7 @@ package body System.Tasking.Stages is
             SSE.Storage_Offset (Parameters.Sec_Stack_Percentage) / 100;
 
       Secondary_Stack : aliased SSE.Storage_Array (1 .. Secondary_Stack_Size);
+      for Secondary_Stack'Alignment use Standard'Maximum_Alignment;
       --  Actual area allocated for secondary stack
 
       Secondary_Stack_Address : System.Address := Secondary_Stack'Address;
index 94e4510fb8fb7281c23b6586eed0f4f80caa2ce7..d94ae2621d645041c7bd7c70d7c47d0d797e6b96 100644 (file)
@@ -6909,6 +6909,7 @@ package body Sem_Ch3 is
          --  and the full derivation can only be its underlying full view.
 
          Build_Full_Derivation;
+
          if not Is_Completion then
             Set_Full_View (Derived_Type, Full_Der);
          else