From 76860de6f04d53835f0b4418d8b6d96f1e79a09b Mon Sep 17 00:00:00 2001
From: charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 20 Jan 2014 15:25:44 +0000
Subject: 2014-01-20  Robert Dewar  <dewar@adacore.com>

	* s-taasde.ads, gnat_ugn.texi, s-tadeca.adb, sem_res.adb, s-tadeca.ads:
	Minor reformatting and code clean up.

2014-01-20  Arnaud Charlet  <charlet@adacore.com>

	* sem_cat.adb (Validate_Object_Declaration): Relax semantics
	of objects of private type if Relaxed_RM_Semantics.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206823 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ada/ChangeLog     | 10 ++++++++++
 gcc/ada/gnat_ugn.texi |  2 +-
 gcc/ada/s-taasde.ads  | 27 ++++++++++++---------------
 gcc/ada/s-tadeca.adb  | 15 ++++++++-------
 gcc/ada/s-tadeca.ads  |  7 +++----
 gcc/ada/sem_cat.adb   |  8 +++++++-
 gcc/ada/sem_res.adb   | 39 +++++++++++++++++++++------------------
 7 files changed, 62 insertions(+), 46 deletions(-)

(limited to 'gcc')

diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 9e19e1d7237..cc097b2e7b9 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,13 @@
+2014-01-20  Robert Dewar  <dewar@adacore.com>
+
+	* s-taasde.ads, gnat_ugn.texi, s-tadeca.adb, sem_res.adb, s-tadeca.ads:
+	Minor reformatting and code clean up.
+
+2014-01-20  Arnaud Charlet  <charlet@adacore.com>
+
+	* sem_cat.adb (Validate_Object_Declaration): Relax semantics
+	of objects of private type if Relaxed_RM_Semantics.
+
 2014-01-20  Claire Dross  <dross@adacore.com>
 
 	* a-cofove.ads (Vector): Capacity discriminant
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index f4a43ed8f7b..32a7e0f0dee 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -13820,7 +13820,7 @@ identifier case conventions, rules of indentation, and comment layout.
 Note: A newly-redesigned set of formatting algorithms used by gnatpp
 is now available.
 To invoke the old formatting algorithms, use the @option{--pp-old} switch.
-We intend to remove support for @option{--pp-old} at some point.
+Support for @option{--pp-old} will be removed in some future version.
 
 To produce a reformatted file, @command{gnatpp} generates and uses the ASIS
 tree for the input source and thus requires the input to be syntactically and
diff --git a/gcc/ada/s-taasde.ads b/gcc/ada/s-taasde.ads
index 80039feeba9..dc4165a122c 100644
--- a/gcc/ada/s-taasde.ads
+++ b/gcc/ada/s-taasde.ads
@@ -81,7 +81,7 @@ package System.Tasking.Async_Delays is
    --              abort_undefer.all;
    --        end;
    --     end if;
-   --
+
    --     if Timed_Out (DB'Unchecked_Access) then
    --        ...continuation for timeout case...
    --     end if;
@@ -108,9 +108,8 @@ package System.Tasking.Async_Delays is
    pragma Inline (Timed_Out);
    --  Return True if the delay specified in D has timed out
 
-   --  There are child units for delays on Ada.Calendar.Time and
-   --  Ada.Real_Time.Time, so that an application will not need to link in
-   --  features that is not using.
+   --  There are child units for delays on Ada.Calendar.Time/Ada.Real_Time.Time
+   --  so that an application need not link in features that it is not using.
 
 private
 
@@ -119,11 +118,10 @@ private
       --  ID of the calling task
 
       Level : ATC_Level_Base;
-      --  Normally Level is the ATC nesting level of the
-      --  async. select statement to which this delay belongs, but
-      --  after a call has been dequeued we set it to
-      --  ATC_Level_Infinity so that the Cancel operation can
-      --  detect repeated calls, and act idempotently.
+      --  Normally Level is the ATC nesting level of the asynchronous select
+      --  statement to which this delay belongs, but after a call has been
+      --  dequeued we set it to ATC_Level_Infinity so that the Cancel operation
+      --  can detect repeated calls, and act idempotently.
 
       Resume_Time : Duration;
       --  The absolute wake up time, represented as Duration
@@ -135,16 +133,15 @@ private
       --  A double linked list
    end record;
 
-   --  The above "overlaying" of Self_ID and Level to hold other
-   --  data that has a non-overlapping lifetime is an unabashed
-   --  hack to save memory.
+   --  The above "overlaying" of Self_ID and Level to hold other data that has
+   --  a non-overlapping lifetime is an unabashed hack to save memory.
 
    procedure Time_Enqueue
      (T : Duration;
       D : Delay_Block_Access);
    pragma Inline (Time_Enqueue);
-   --  Used by the child units to enqueue delays on the timer queue
-   --  implemented in the body of this package. T denotes a point in time as
-   --  the duration elapsed since the epoch of the Ada real-time clock.
+   --  Used by the child units to enqueue delays on the timer queue implemented
+   --  in the body of this package. T denotes a point in time as the duration
+   --  elapsed since the epoch of the Ada real-time clock.
 
 end System.Tasking.Async_Delays;
diff --git a/gcc/ada/s-tadeca.adb b/gcc/ada/s-tadeca.adb
index fa1ef05e8d7..99fbe1450b3 100644
--- a/gcc/ada/s-tadeca.adb
+++ b/gcc/ada/s-tadeca.adb
@@ -30,15 +30,15 @@
 ------------------------------------------------------------------------------
 
 with Ada.Calendar.Delays;
+
 with System.OS_Constants;
 with System.OS_Primitives;
 with System.Task_Primitives.Operations;
 with System.Tasking.Initialization;
 
 function System.Tasking.Async_Delays.Enqueue_Calendar
-  (T    : Ada.Calendar.Time;
-   D    : Delay_Block_Access)
-   return Boolean
+  (T : Ada.Calendar.Time;
+   D : Delay_Block_Access) return Boolean
 is
    use type Ada.Calendar.Time;
 
@@ -55,12 +55,13 @@ begin
    end if;
 
    --  T is expressed as a duration elapsed since the UNIX epoch, whereas
-   --  Time_Enque expects duraction elapsed since the epoch of the Ada
-   --  real time clock: compensate if necessary.
+   --  Time_Enque expects duraction elapsed since the epoch of the Ada real-
+   --  time clock: compensate if necessary.
 
-   pragma Warnings (Off);
    --  Comparison "SOSC.CLOCK_RT_Ada = SOSC.CLOCK_REALTIME" is compile
-   --  time known.
+   --  time known, so turn warnings off.
+
+   pragma Warnings (Off);
 
    if SOSC.CLOCK_RT_Ada /= SOSC.CLOCK_REALTIME then
       pragma Warnings (On);
diff --git a/gcc/ada/s-tadeca.ads b/gcc/ada/s-tadeca.ads
index 81bd4e18a94..ac6a270c87e 100644
--- a/gcc/ada/s-tadeca.ads
+++ b/gcc/ada/s-tadeca.ads
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  S p e c                                 --
 --                                                                          --
---          Copyright (C) 1998-2009, Free Software Foundation, Inc.         --
+--          Copyright (C) 1998-2013, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNARL 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- --
@@ -36,6 +36,5 @@
 
 with Ada.Calendar;
 function System.Tasking.Async_Delays.Enqueue_Calendar
-  (T    : Ada.Calendar.Time;
-   D    : Delay_Block_Access)
-   return Boolean;
+  (T : Ada.Calendar.Time;
+   D : Delay_Block_Access) return Boolean;
diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb
index 79201c4edf0..92979c7ab16 100644
--- a/gcc/ada/sem_cat.adb
+++ b/gcc/ada/sem_cat.adb
@@ -1225,7 +1225,13 @@ package body Sem_Cat is
                   --  means that a pragma Preelaborable_Initialization was
                   --  given for the private type.
 
-                  if Has_Preelaborable_Initialization (Ent) then
+                  if Relaxed_RM_Semantics then
+                     --  In relaxed mode, do not issue these messages, this
+                     --  is basically similar to the GNAT_Mode test below.
+
+                     null;
+
+                  elsif Has_Preelaborable_Initialization (Ent) then
 
                      --  But for the predefined units, we will ignore this
                      --  status unless we are in Ada 2005 mode since we want
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 56b6aeec1e5..6861f1a00b0 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -2156,20 +2156,6 @@ package body Sem_Res is
                --  First matching interpretation
 
                if not Found then
-                  --  If the current statement is part of a predefined library
-                  --  unit, then all interpretations which come from user level
-                  --  packages should not be considered. User-defined operators
-                  --  may appear anywhere in the homonym list. This exclusion
-                  --  does not apply in an instance, where an actual may come
-                  --  from a local declaration.
-
-                  if From_Lib
-                    and then not Comes_From_Predefined_Lib_Unit (It.Nam)
-                    and then not In_Instance
-                  then
-                     goto Continue;
-                  end if;
-
                   Found := True;
                   I1    := I;
                   Seen  := It.Nam;
@@ -2181,12 +2167,29 @@ package body Sem_Res is
                --  some more obscure cases are handled in Disambiguate.
 
                else
-                  if From_Lib
-                    and then not Comes_From_Predefined_Lib_Unit (It.Nam)
-                  then
-                     goto Continue;
+                  --  If the current statement is part of a predefined library
+                  --  unit, then all interpretations which come from user level
+                  --  packages should not be considered. Check previous and
+                  --  current one.
+
+                  if From_Lib then
+                     if not Comes_From_Predefined_Lib_Unit (It.Nam) then
+                        goto Continue;
+
+                     elsif not Comes_From_Predefined_Lib_Unit (Seen) then
+
+                        --  Previous interpretation must be discarded.
+
+                        I1    := I;
+                        Seen  := It.Nam;
+                        Expr_Type := It.Typ;
+                        Set_Entity (N, Seen);
+                        goto Continue;
+                     end if;
                   end if;
 
+                  --  Otherwise apply further disambiguation steps.
+
                   Error_Msg_Sloc := Sloc (Seen);
                   It1 := Disambiguate (N, I1, I, Typ);
 
-- 
cgit v1.2.1