aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-10-11 12:07:06 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-11 12:07:06 +0200
commit44bf8eb058405766cf8e05a740c63644244e218b (patch)
treeea3db1ae3135a8af79bd7e6657e739ecfc21ef62 /gcc/ada
parentcead616d5659c95f8981a1b1f735fa7aea02de0f (diff)
downloadgcc-44bf8eb058405766cf8e05a740c63644244e218b.zip
gcc-44bf8eb058405766cf8e05a740c63644244e218b.tar.gz
gcc-44bf8eb058405766cf8e05a740c63644244e218b.tar.bz2
[multiple changes]
2010-10-11 Arnaud Charlet <charlet@adacore.com> * sem_ch3.adb, exp_ch6.adb (Make_Build_In_Place_Call_In_Anonymous_Context, Make_Build_In_Place_Call_In_Assignment, Make_Build_In_Place_Call_In_Object_Declaration): Fix calls to Add_Task_Actuals_To_Build_In_Place_Call in case of No_Task_Hierarchy restriction. (Access_Definition): Add missing handling of No_Task_Hierarchy. 2010-10-11 Javier Miranda <miranda@adacore.com> * exp_util.adb (Remove_Side_Effects): No action needed for renamings of class-wide expressions. From-SVN: r165293
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog15
-rw-r--r--gcc/ada/exp_ch6.adb14
-rw-r--r--gcc/ada/exp_util.adb11
-rw-r--r--gcc/ada/sem_ch3.adb1
4 files changed, 37 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 9fca74b..6401df7 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,20 @@
2010-10-11 Arnaud Charlet <charlet@adacore.com>
+ * sem_ch3.adb, exp_ch6.adb
+ (Make_Build_In_Place_Call_In_Anonymous_Context,
+ Make_Build_In_Place_Call_In_Assignment,
+ Make_Build_In_Place_Call_In_Object_Declaration): Fix calls to
+ Add_Task_Actuals_To_Build_In_Place_Call in case of No_Task_Hierarchy
+ restriction.
+ (Access_Definition): Add missing handling of No_Task_Hierarchy.
+
+2010-10-11 Javier Miranda <miranda@adacore.com>
+
+ * exp_util.adb (Remove_Side_Effects): No action needed for renamings of
+ class-wide expressions.
+
+2010-10-11 Arnaud Charlet <charlet@adacore.com>
+
* xr_tabls.adb, sem_res.adb: Minor reformatting
2010-10-11 Arnaud Charlet <charlet@adacore.com>
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 37df0d5..bd36580 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -475,8 +475,8 @@ package body Exp_Ch6 is
Master_Actual : Node_Id)
-- Note: Master_Actual can be Empty, but only if there are no tasks
is
- Loc : constant Source_Ptr := Sloc (Function_Call);
-
+ Loc : constant Source_Ptr := Sloc (Function_Call);
+ Actual : Node_Id := Master_Actual;
begin
-- No such extra parameters are needed if there are no tasks
@@ -484,6 +484,12 @@ package body Exp_Ch6 is
return;
end if;
+ -- Use a dummy _master actual in case of No_Task_Hierarchy
+
+ if Restriction_Active (No_Task_Hierarchy) then
+ Actual := New_Occurrence_Of (RTE (RE_Library_Task_Level), Loc);
+ end if;
+
-- The master
declare
@@ -493,13 +499,13 @@ package body Exp_Ch6 is
Master_Formal := Build_In_Place_Formal (Function_Id, BIP_Master);
- Analyze_And_Resolve (Master_Actual, Etype (Master_Formal));
+ Analyze_And_Resolve (Actual, Etype (Master_Formal));
-- Build the parameter association for the new actual and add it to
-- the end of the function's actuals.
Add_Extra_Actual_To_Call
- (Function_Call, Master_Formal, Master_Actual);
+ (Function_Call, Master_Formal, Actual);
end;
-- The activation chain
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index fc2bb69..980f0f6 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -4839,6 +4839,17 @@ package body Exp_Util is
return;
end if;
+ -- No action needed for renamings of class-wide expressions because for
+ -- class-wide types Remove_Side_Effects uses a renaming to capture the
+ -- expression (and hence we would generate a never-ending loop in the
+ -- frontend).
+
+ if Is_Class_Wide_Type (Exp_Type)
+ and then Nkind (Parent (Exp)) = N_Object_Renaming_Declaration
+ then
+ return;
+ end if;
+
-- All this must not have any checks
Scope_Suppress := (others => True);
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 3320c14..29f28b0 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -884,6 +884,7 @@ package body Sem_Ch3 is
elsif Has_Task (Desig_Type)
and then Comes_From_Source (Related_Nod)
+ and then not Restriction_Active (No_Task_Hierarchy)
then
if not Has_Master_Entity (Current_Scope) then
Decl :=