[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 23 Jan 2012 08:38:15 +0000 (09:38 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 23 Jan 2012 08:38:15 +0000 (09:38 +0100)
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

gcc/ada/ChangeLog
gcc/ada/errout.adb
gcc/ada/sem_ch10.adb
gcc/ada/sem_res.adb

index 0682c646a61bf6c426d3c4ec1a2011ad21bf7a15..6104a07684ba65130bf9b4b561f7654809674bff 100644 (file)
@@ -1,3 +1,13 @@
+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.
+
 2012-01-23  Gary Dismukes  <dismukes@adacore.com>
 
        * exp_util.adb (Is_Iterated_Container): Test
index 5e3bb4a81e55f86b3ea3571b53dec389d13c70df..b342b75400ea866930375c61d57f3b8294e8c43f 100644 (file)
@@ -143,9 +143,9 @@ package body Errout is
    --  parameter Suffix, (spec) or (body) is appended after the unit name.
 
    procedure Set_Msg_Node (Node : Node_Id);
-   --  Add the sequence of characters for the name associated with the
-   --  given node to the current message. For N_Designator, N_Defining_Program_
-   --  Unit_Name, N_Selected_Component, and N_Expanded_Name, the Prefix is
+   --  Add the sequence of characters for the name associated with the given
+   --  node to the current message. For N_Designator, N_Selected_Component,
+   --  N_Defining_Program_Unit_Name, and N_Expanded_Name, the Prefix is
    --  included as well.
 
    procedure Set_Msg_Text (Text : String; Flag : Source_Ptr);
index 4d0514d6a8669e95678e2c610a22721e3e581ac2..07dfdf6676cea373d4366e0657e1f4029238ea78 100644 (file)
@@ -644,9 +644,7 @@ package body Sem_Ch10 is
       --  up not analyzed, it means that the parent did not contain a stub for
       --  it, or that there errors were detected in some ancestor.
 
-      if Nkind (Unit_Node) = N_Subunit
-        and then not Analyzed (Lib_Unit)
-      then
+      if Nkind (Unit_Node) = N_Subunit and then not Analyzed (Lib_Unit) then
          Semantics (Lib_Unit);
 
          if not Analyzed (Proper_Body (Unit_Node)) then
index c25a305daab41a624410dca47fcbed069d6a5d8e..0fecd5b53d79d0d9e413b3a63ec0c1a7d2728804 100644 (file)
@@ -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