aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-10-25 15:50:29 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-25 15:50:29 +0200
commit1e194575d06f78b82061218f6405c5e8a21ce085 (patch)
treeb40bec5a75f1448c3dd1c6683682b9d8c1544311 /gcc/ada/sem_res.adb
parent89ff4f167f64c73b46ebc30221119b76887c1b77 (diff)
downloadgcc-1e194575d06f78b82061218f6405c5e8a21ce085.zip
gcc-1e194575d06f78b82061218f6405c5e8a21ce085.tar.gz
gcc-1e194575d06f78b82061218f6405c5e8a21ce085.tar.bz2
[multiple changes]
2010-10-25 Matthew Heaney <heaney@adacore.com> * Makefile.rtl, impunit.adb: Added a-cobove (bounded vector container) to lists. * a-contai.ads: Added declaration of Capacity_Error exception. * a-cobove.ads, a-cobove.adb: New files. 2010-10-25 Thomas Quinot <quinot@adacore.com> * uname.adb: Revert previous change, no longer needed after change in par-ch10.adb. 2010-10-25 Thomas Quinot <quinot@adacore.com> * scos.ads: Minor comment fix. 2010-10-25 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb (Analyze_Assignment_Statement): Check dangerous order dependence. * sem_ch6.adb (Analyze_Procedure_Call_Statement): Ditto. * sem_res.adb (Analyze_Actuals): Add actual to list of actuals for current construct, for subsequent order dependence checking. (Resolve): Check order dependence on expressions that are not subexpressions. * sem_util.adb (Check_Order_Dependence): Code cleanup, to correspond to latest version of AI05-144-2. * sem_warn.adb (Warn_On_Overlapping_Actuals): Code cleanup. 2010-10-25 Robert Dewar <dewar@adacore.com> * sem_ch13.adb (Build_Static_Predicate): Moved out of Build_Predicate_Function. (Build_Static_Predicate): Complet rewrite for more general predicates From-SVN: r165917
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb23
1 files changed, 15 insertions, 8 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index de83fa2..e92477e 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -2744,6 +2744,18 @@ package body Sem_Res is
return;
end if;
+ -- AI05-144-2: Check dangerous order dependence within an expression
+ -- that is not a subexpression. Exclude RHS of an assignment, because
+ -- both sides may have side-effects and the check must be performed
+ -- over the statement.
+
+ if Nkind (Parent (N)) not in N_Subexpr
+ and then Nkind (Parent (N)) /= N_Assignment_Statement
+ and then Nkind (Parent (N)) /= N_Procedure_Call_Statement
+ then
+ Check_Order_Dependence;
+ end if;
+
-- The expression is definitely NOT overloaded at this point, so
-- we reset the Is_Overloaded flag to avoid any confusion when
-- reanalyzing the node.
@@ -3529,12 +3541,10 @@ package body Sem_Res is
A_Typ := Etype (A);
F_Typ := Etype (F);
- -- Save actual for subsequent check on order dependence,
- -- and indicate whether actual is modifiable. For AI05-0144
+ -- Save actual for subsequent check on order dependence, and
+ -- indicate whether actual is modifiable. For AI05-0144-2.
- -- Save_Actual (A,
- -- Ekind (F) /= E_In_Parameter or else Is_Access_Type (F_Typ));
- -- Why is this code commented out ???
+ Save_Actual (A, Ekind (F) /= E_In_Parameter);
-- For mode IN, if actual is an entity, and the type of the formal
-- has warnings suppressed, then we reset Never_Set_In_Source for
@@ -8228,11 +8238,8 @@ package body Sem_Res is
R : constant Node_Id := Right_Opnd (N);
begin
- -- Why are the calls to Check_Order_Dependence commented out ???
Resolve (L, B_Typ);
- -- Check_Order_Dependence; -- For AI05-0144
Resolve (R, B_Typ);
- -- Check_Order_Dependence; -- For AI05-0144
-- Check for issuing warning for always False assert/check, this happens
-- when assertions are turned off, in which case the pragma Assert/Check