From 67bdbf1ebd52a2599cae74d4b1b6def861c8c8bc Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 23 Jan 2012 09:38:15 +0100 Subject: [PATCH] [multiple changes] 2012-01-23 Robert Dewar * sem_ch10.adb, errout.adb: Minor reformatting. 2012-01-23 Ed Schonberg * 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 | 10 ++++++++++ gcc/ada/errout.adb | 6 +++--- gcc/ada/sem_ch10.adb | 4 +--- gcc/ada/sem_res.adb | 13 +++++++++++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 0682c646a61..6104a07684b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2012-01-23 Robert Dewar + + * sem_ch10.adb, errout.adb: Minor reformatting. + +2012-01-23 Ed Schonberg + + * 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 * exp_util.adb (Is_Iterated_Container): Test diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index 5e3bb4a81e5..b342b75400e 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -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); diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index 4d0514d6a86..07dfdf6676c 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -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 diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index c25a305daab..0fecd5b53d7 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