summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-04 10:41:40 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-04 10:41:40 +0000
commit4504af0f228315c31b411a19b86f888bd4674118 (patch)
tree3cc51d0990eeb856addf1f5cfbd49c2cc9ecc50d /gcc/ada
parent4c1ff5095967c9ebcd1805725cd35b628a8e376a (diff)
downloadgcc-4504af0f228315c31b411a19b86f888bd4674118.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213565 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog18
-rw-r--r--gcc/ada/einfo.adb2
-rw-r--r--gcc/ada/einfo.ads14
-rw-r--r--gcc/ada/inline.adb19
-rw-r--r--gcc/ada/s-tarest.adb1
-rw-r--r--gcc/ada/s-tassta.adb1
-rw-r--r--gcc/ada/sem_ch3.adb1
7 files changed, 48 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index c45e77a9972..26d63fad439 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index f3899a93bb7..d4a5260541e 100644
--- a/gcc/ada/einfo.adb
+++ b/gcc/ada/einfo.adb
@@ -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;
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index 14bb0d0d28e..491e84dd4b3 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -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
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index 7a3b2a706b6..022bc7656a8 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -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
diff --git a/gcc/ada/s-tarest.adb b/gcc/ada/s-tarest.adb
index c746ab9e17c..d8478fa7b7a 100644
--- a/gcc/ada/s-tarest.adb
+++ b/gcc/ada/s-tarest.adb
@@ -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;
diff --git a/gcc/ada/s-tassta.adb b/gcc/ada/s-tassta.adb
index 1cf83dad099..971879c5f23 100644
--- a/gcc/ada/s-tassta.adb
+++ b/gcc/ada/s-tassta.adb
@@ -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;
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 94e4510fb8f..d94ae2621d6 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -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