aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-01-23 09:38:15 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2012-01-23 09:38:15 +0100
commit67bdbf1ebd52a2599cae74d4b1b6def861c8c8bc (patch)
tree792053cddb8383795b1faf2619468aa69140dd34 /gcc/ada/sem_res.adb
parent022d9ce887c7ca3637c597ed81d90d66e23071a1 (diff)
downloadgcc-67bdbf1ebd52a2599cae74d4b1b6def861c8c8bc.zip
gcc-67bdbf1ebd52a2599cae74d4b1b6def861c8c8bc.tar.gz
gcc-67bdbf1ebd52a2599cae74d4b1b6def861c8c8bc.tar.bz2
[multiple changes]
2012-01-23 Robert Dewar <dewar@adacore.com> * sem_ch10.adb, errout.adb: Minor reformatting. 2012-01-23 Ed Schonberg <schonberg@adacore.com> * sem_res.adb (Resolve_Actuals): An actual in a call to an Ada 2012 Reference function does not lead to a dangerous order dependence. From-SVN: r183409
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index c25a305..0fecd5b 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -3739,7 +3739,16 @@ package body Sem_Res is
-- 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);
+ -- If this is a call to a reference function that is the result
+ -- of expansion, as in element iterator loops, this does not lead
+ -- to a dangerous order dependence: only subsequent use of the
+ -- denoted element might, in some enclosing call.
+
+ if not Has_Implicit_Dereference (Etype (Nam))
+ or else Comes_From_Source (N)
+ then
+ Save_Actual (A, Ekind (F) /= E_In_Parameter);
+ end if;
-- 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