+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
function Returns_Limited_View (Id : E) return B is
begin
+ pragma Assert (Ekind (Id) = E_Function);
return Flag134 (Id);
end Returns_Limited_View;
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;
-- 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
-- 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.
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
-- 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
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;
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;
-- 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