[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 20 Apr 2016 09:04:48 +0000 (11:04 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 20 Apr 2016 09:04:48 +0000 (11:04 +0200)
2016-04-20  Gary Dismukes  <dismukes@adacore.com>

* par_sco.adb, sem_util.adb, sem_ch13.adb: Minor typo corrections and
reformatting.

2016-04-20  Ed Schonberg  <schonberg@adacore.com>

* sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
If the pragma comes from an aspect specification, verify that
the aspect applies to an entity with a declarative part.
* exp_ch5.adb: Code cleanup.

2016-04-20  Ed Schonberg  <schonberg@adacore.com>

* sem_res.adb (Resolve_If_Expression): If first expression is
universal, resolve subsequent ones with the corresponding class
type (Any_Integer or Any_Real).

2016-04-20  Ed Schonberg  <schonberg@adacore.com>

* sem_ch5.adb (Analyze_Iterator_Specification): If expansion is
disabled, complete the analysis of the iterator name to ensure
that reference for entities within are properly generated.

2016-04-20  Arnaud Charlet  <charlet@adacore.com>

* a-dispat.ads (Yield): add Global contract.
* a-calend.ads, a-reatim.ads: Added Initializes => Clock_Time.
* a-taside.adb: Added Initializes => Tasking_State.

From-SVN: r235240

12 files changed:
gcc/ada/ChangeLog
gcc/ada/a-calend.ads
gcc/ada/a-dispat.ads
gcc/ada/a-reatim.ads
gcc/ada/a-taside.ads
gcc/ada/exp_ch5.adb
gcc/ada/par_sco.adb
gcc/ada/sem_ch13.adb
gcc/ada/sem_ch5.adb
gcc/ada/sem_prag.adb
gcc/ada/sem_res.adb
gcc/ada/sem_util.adb

index 93e1eeb..75201ec 100644 (file)
@@ -1,3 +1,33 @@
+2016-04-20  Gary Dismukes  <dismukes@adacore.com>
+
+       * par_sco.adb, sem_util.adb, sem_ch13.adb: Minor typo corrections and
+       reformatting.
+
+2016-04-20  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
+       If the pragma comes from an aspect specification, verify that
+       the aspect applies to an entity with a declarative part.
+       * exp_ch5.adb: Code cleanup.
+
+2016-04-20  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_res.adb (Resolve_If_Expression): If first expression is
+       universal, resolve subsequent ones with the corresponding class
+       type (Any_Integer or Any_Real).
+
+2016-04-20  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch5.adb (Analyze_Iterator_Specification): If expansion is
+       disabled, complete the analysis of the iterator name to ensure
+       that reference for entities within are properly generated.
+
+2016-04-20  Arnaud Charlet  <charlet@adacore.com>
+
+       * a-dispat.ads (Yield): add Global contract.
+       * a-calend.ads, a-reatim.ads: Added Initializes => Clock_Time.
+       * a-taside.adb: Added Initializes => Tasking_State.
+
 2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * sem_ch13.adb (Build_Invariant_Procedure):
index d765103..39e9c33 100644 (file)
@@ -37,7 +37,8 @@ package Ada.Calendar with
   SPARK_Mode,
   Abstract_State => (Clock_Time with Synchronous,
                                      External => (Async_Readers,
-                                                  Async_Writers))
+                                                  Async_Writers)),
+  Initializes    => Clock_Time
 is
 
    type Time is private;
index a193940..b4e4d03 100644 (file)
@@ -16,7 +16,8 @@
 package Ada.Dispatching is
    pragma Preelaborate (Dispatching);
 
-   procedure Yield;
+   procedure Yield with
+     Global => null;
 
    Dispatching_Policy_Error : exception;
 end Ada.Dispatching;
index 8b341c0..cb84859 100644 (file)
@@ -40,7 +40,8 @@ package Ada.Real_Time with
   SPARK_Mode,
   Abstract_State => (Clock_Time with Synchronous,
                                      External => (Async_Readers,
-                                                  Async_Writers))
+                                                  Async_Writers)),
+  Initializes    => Clock_Time
 is
 
    pragma Compile_Time_Error
index ee39ec3..72467bf 100644 (file)
@@ -40,7 +40,8 @@ package Ada.Task_Identification with
   SPARK_Mode,
   Abstract_State => (Tasking_State with Synchronous,
                                         External => (Async_Readers,
-                                                     Async_Writers))
+                                                     Async_Writers)),
+  Initializes    => Tasking_State
 is
    pragma Preelaborate;
    --  In accordance with Ada 2005 AI-362
index 25a9fe0..d7a0d9e 100644 (file)
@@ -1696,7 +1696,7 @@ package body Exp_Ch5 is
             --  subprogram. In restricted profiles this is not available.
 
             if Nkind (Ent) = N_Function_Call
-              and then RTE_Available (RE_Get_Ceiling)
+              and then not Configurable_Run_Time_Mode
               and then (Entity (Name (Ent)) = RTE (RE_Get_Ceiling)
                           or else
                         Entity (Name (Ent)) = RTE (RO_PE_Get_Ceiling))
index 1aa4bc9..d10e1d2 100644 (file)
@@ -2797,7 +2797,7 @@ package body Par_SCO is
                   when others =>
                      if T.C2 = '?' then
 
-                        --  This in not a logical operator: start looking for
+                        --  This is not a logical operator: start looking for
                         --  nested decisions from here. Recurse over the left
                         --  child and let the loop take care of the right one.
 
@@ -2849,7 +2849,7 @@ package body Par_SCO is
                   when others =>
                      if T.C2 = '?' and then Process_Nested_Decisions then
 
-                        --  This in not a logical operator: start looking for
+                        --  This is not a logical operator: start looking for
                         --  nested decisions from here. Recurse over the left
                         --  child and let the loop take care of the right one.
 
index 5fc8304..aa929bd 100644 (file)
@@ -8336,7 +8336,7 @@ package body Sem_Ch13 is
                  Statements => Stmts));
 
          --  The processing of an invariant pragma immediately generates the
-         --  invariant procedure spec, inserts it into the tree and analyzes
+         --  invariant procedure spec, inserts it into the tree, and analyzes
          --  it. If the spec has not been analyzed, then the invariant pragma
          --  is being inherited and requires manual insertion and analysis.
 
@@ -8362,9 +8362,9 @@ package body Sem_Ch13 is
             end if;
 
          --  Otherwise there are no private declarations. This is either an
-         --  error or the related type is a private extension in which case
+         --  error or the related type is a private extension, in which case
          --  it does not need a completion in a private part. Insert the body
-         --  and the end of the visible declarations and analyze immediately
+         --  at the end of the visible declarations and analyze immediately
          --  because the related type is about to be frozen.
 
          else
index 657a0e4..64b05ff 100644 (file)
@@ -1925,11 +1925,12 @@ package body Sem_Ch5 is
 
         --  Do not perform this expansion in SPARK mode, since the formal
         --  verification directly deals with the source form of the iterator.
-        --  Ditto for ASIS, where the temporary may hide the transformation
-        --  of a selected component into a prefixed function call.
+        --  Ditto for ASIS and when expansion is disabled,, where the temporary
+        --  may hide the transformation of a selected component into a prefixed
+        --  function call, and references need to see the original expression.
 
         and then not GNATprove_Mode
-        and then not ASIS_Mode
+        and then Expander_Active
       then
          declare
             Id    : constant Entity_Id := Make_Temporary (Loc, 'R', Iter_Name);
@@ -2016,7 +2017,7 @@ package body Sem_Ch5 is
       --  Iterate is not a reserved name. What matters is that the return type
       --  of the function is an iterator type.
 
-      elsif Is_Entity_Name (Iter_Name) then
+      elsif Is_Entity_Name (Iter_Name) or else not Expander_Active then
          Analyze (Iter_Name);
 
          if Nkind (Iter_Name) = N_Function_Call then
@@ -2266,9 +2267,11 @@ package body Sem_Ch5 is
             --  If that object is a selected component, verify that it is not
             --  a component of an unconstrained mutable object.
 
-            if Nkind (Iter_Name) = N_Identifier then
+            if Nkind (Iter_Name) = N_Identifier
+              or else (not Expander_Active and Comes_From_Source (Iter_Name))
+            then
                declare
-                  Orig_Node : constant Node_Id := Original_Node (Iter_Name);
+                  Orig_Node : constant Node_Id   := Original_Node (Iter_Name);
                   Iter_Kind : constant Node_Kind := Nkind (Orig_Node);
                   Obj       : Node_Id;
 
index d929c85..22daf49 100644 (file)
@@ -13582,6 +13582,17 @@ package body Sem_Prag is
                Check_Is_In_Decl_Part_Or_Package_Spec;
             end if;
 
+            if From_Aspect_Specification (N) then
+               declare
+                  E : constant Entity_Id := Entity (Corresponding_Aspect (N));
+               begin
+                  if not In_Open_Scopes (E) then
+                     Error_Msg_N
+                       ("aspect must apply to package or subprogram", N);
+                  end if;
+               end;
+            end if;
+
             if Present (Arg1) then
                Pool := Get_Pragma_Arg (Arg1);
 
index 29c5612..e8495c7 100644 (file)
@@ -8048,9 +8048,19 @@ package body Sem_Res is
       end if;
 
       --  If ELSE expression present, just resolve using the determined type
+      --  If type is universal, resolve to any member of the class.
 
       if Present (Else_Expr) then
-         Resolve (Else_Expr, Typ);
+         if Typ = Universal_Integer then
+            Resolve (Else_Expr, Any_Integer);
+
+         elsif Typ = Universal_Real then
+            Resolve (Else_Expr, Any_Real);
+
+         else
+            Resolve (Else_Expr, Typ);
+         end if;
+
          Else_Typ := Etype (Else_Expr);
 
          if Is_Scalar_Type (Else_Typ) and then Else_Typ /= Typ then
index d03eca8..e9e16ae 100644 (file)
@@ -1664,8 +1664,8 @@ package body Sem_Util is
 
       --  See if we need elaboration entity.
 
-      --  We always need an elaboration entity when preserving control-flow, as
-      --  we want to remain explicit about the units elaboration order.
+      --  We always need an elaboration entity when preserving control flow, as
+      --  we want to remain explicit about the unit's elaboration order.
 
       elsif Opt.Suppress_Control_Flow_Optimizations then
          null;