aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-16 13:41:29 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-16 13:41:29 +0000
commit829967f1aa91bbb942b6aff327e04627e7099070 (patch)
treef9e873bd79131ffc12f463a8de5aa67ea40b6b21
parent8421bfe4f9b66fe68d0c885307023ee6ce389759 (diff)
2015-10-16 Javier Miranda <miranda@adacore.com>
* sem_ch5.adb (Analyze_Iterator_Specification): Associate a transient scope with the renaming object declararation. * exp_util.adb (Insert_Actions): if the enclosing interator loop is marked as requiring the secondary stack then attach the actions to the transient scope. 2015-10-16 Bob Duff <duff@adacore.com> * exp_ch7.adb: Minor spelling fixes. 2015-10-16 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Replace_Anonymous_Access_To_Protected_Subprogram): If anonymous type is component type of array type declaration, analyze its declaration in the current scope, not the enclosing one. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228906 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog19
-rw-r--r--gcc/ada/exp_ch7.adb18
-rw-r--r--gcc/ada/exp_util.adb16
-rw-r--r--gcc/ada/sem_ch3.adb8
-rw-r--r--gcc/ada/sem_ch5.adb11
-rw-r--r--gcc/ada/sem_util.adb6
6 files changed, 65 insertions, 13 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 9c0689623cb..d8f2b58a107 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,22 @@
+2015-10-16 Javier Miranda <miranda@adacore.com>
+
+ * sem_ch5.adb (Analyze_Iterator_Specification): Associate a
+ transient scope with the renaming object declararation.
+ * exp_util.adb (Insert_Actions): if the enclosing interator
+ loop is marked as requiring the secondary stack then attach the
+ actions to the transient scope.
+
+2015-10-16 Bob Duff <duff@adacore.com>
+
+ * exp_ch7.adb: Minor spelling fixes.
+
+2015-10-16 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Replace_Anonymous_Access_To_Protected_Subprogram):
+ If anonymous type is component type of array type declaration,
+ analyze its declaration in the current scope, not the enclosing
+ one.
+
2015-10-16 Gary Dismukes <dismukes@adacore.com>
* prj.adb, sem_util.adb, exp_ch6.adb: Minor reformatting.
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index 2f90c92cbe3..3836e8575ea 100644
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -1109,7 +1109,7 @@ package body Exp_Ch7 is
Finalizer_Decls : List_Id := No_List;
-- Local variable declarations. This list holds the label declarations
-- of all jump block alternatives as well as the declaration of the
- -- local exception occurence and the raised flag:
+ -- local exception occurrence and the raised flag:
-- E : Exception_Occurrence;
-- Raised : Boolean := False;
-- L<counter value> : label;
@@ -5283,7 +5283,7 @@ package body Exp_Ch7 is
-- Abort : constant Boolean := Triggered_By_Abort;
-- <or>
-- Abort : constant Boolean := False; -- no abort
- -- E : Exception_Occurence;
+ -- E : Exception_Occurrence;
-- Raised : Boolean := False;
-- begin
@@ -6047,7 +6047,7 @@ package body Exp_Ch7 is
-- when others =>
-- if not Raised then
-- Raised := True;
- -- Save_Occurence (E, Get_Current_Excep.all.all);
+ -- Save_Occurrence (E, Get_Current_Excep.all.all);
-- end if;
-- end;
-- end if;
@@ -6065,7 +6065,7 @@ package body Exp_Ch7 is
-- Abort : constant Boolean := Triggered_By_Abort;
-- <or>
-- Abort : constant Boolean := False; -- no abort
- -- E : Exception_Occurence;
+ -- E : Exception_Occurrence;
-- Raised : Boolean := False;
--
-- begin
@@ -6076,7 +6076,7 @@ package body Exp_Ch7 is
-- when others =>
-- if not Raised then
-- Raised := True;
- -- Save_Occurence (E, Get_Current_Excep.all.all);
+ -- Save_Occurrence (E, Get_Current_Excep.all.all);
-- end if;
-- end;
-- end if;
@@ -6100,7 +6100,7 @@ package body Exp_Ch7 is
-- when others =>
-- if not Raised then
-- Raised := True;
- -- Save_Occurence (E, Get_Current_Excep.all.all);
+ -- Save_Occurrence (E, Get_Current_Excep.all.all);
-- end if;
-- end;
-- . . .
@@ -6111,7 +6111,7 @@ package body Exp_Ch7 is
-- when others =>
-- if not Raised then
-- Raised := True;
- -- Save_Occurence (E, Get_Current_Excep.all.all);
+ -- Save_Occurrence (E, Get_Current_Excep.all.all);
-- end if;
-- end;
-- <<L0>>
@@ -6533,7 +6533,7 @@ package body Exp_Ch7 is
-- <or>
-- Abort : constant Boolean := False; -- no abort
- -- E : Exception_Occurence;
+ -- E : Exception_Occurrence;
-- Raised : Boolean := False;
-- begin
@@ -7105,7 +7105,7 @@ package body Exp_Ch7 is
-- <or>
-- Abort : constant Boolean := False; -- no abort
- -- E : Exception_Occurence;
+ -- E : Exception_Occurrence;
-- Raised : Boolean := False;
-- begin
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index fb0d487ef38..56f9b9a043b 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -4034,6 +4034,22 @@ package body Exp_Util is
end if;
return;
+
+ -- Iteration scheme located in a transient scope
+
+ elsif Nkind (P) = N_Iteration_Scheme
+ and then Present (Wrapped_Node)
+ then
+ -- If the enclosing iterator loop is marked as requiring the
+ -- secondary stack then the actions must be inserted in the
+ -- transient scope.
+
+ if Uses_Sec_Stack
+ (Find_Enclosing_Iterator_Loop (Current_Scope))
+ then
+ Store_Before_Actions_In_Scope (Ins_Actions);
+ return;
+ end if;
end if;
-- Statements, declarations, pragmas, representation clauses
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index f21edeb057e..542ea3f9c1d 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -5913,7 +5913,13 @@ package body Sem_Ch3 is
Mark_Rewrite_Insertion (Comp);
- if Nkind_In (N, N_Object_Declaration, N_Access_Function_Definition) then
+ if Nkind_In (N, N_Object_Declaration, N_Access_Function_Definition)
+ or else (Nkind (Parent (N)) = N_Full_Type_Declaration
+ and then not Is_Type (Current_Scope))
+ then
+
+ -- Declaration can be analyzed in the current scope.
+
Analyze (Decl);
else
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index d2d5f25f3f3..234317c0f1d 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -30,6 +30,7 @@ with Einfo; use Einfo;
with Errout; use Errout;
with Expander; use Expander;
with Exp_Ch6; use Exp_Ch6;
+with Exp_Ch7; use Exp_Ch7;
with Exp_Util; use Exp_Util;
with Freeze; use Freeze;
with Ghost; use Ghost;
@@ -1959,6 +1960,16 @@ package body Sem_Ch5 is
Name =>
New_Copy_Tree (Iter_Name, New_Sloc => Loc));
+ -- Create a transient scope to ensure that all the temporaries
+ -- generated by Remove_Side_Effects as part of processing this
+ -- renaming declaration (if any) are attached by Insert_Actions
+ -- to it. It has no effect on the generated code if no actions
+ -- are added to it (see Wrap_Transient_Declaration).
+
+ if Expander_Active then
+ Establish_Transient_Scope (Name (Decl), Sec_Stack => True);
+ end if;
+
Insert_Actions (Parent (Parent (N)), New_List (Decl));
Rewrite (Name (N), New_Occurrence_Of (Id, Loc));
Set_Etype (Id, Typ);
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 214ec62ad7f..2fa6253df37 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -2346,9 +2346,9 @@ package body Sem_Util is
return Id;
end Get_Function_Id;
- ---------------------------
- -- Preanalyze_Expression --
- ---------------------------
+ -------------------------------
+ -- Preanalyze_Without_Errors --
+ -------------------------------
procedure Preanalyze_Without_Errors (N : Node_Id) is
Status : constant Boolean := Get_Ignore_Errors;