aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2016-04-20 11:04:48 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2016-04-20 11:04:48 +0200
commit93e90bf474fd9410af5127417d542c2f80466ca4 (patch)
tree8616898e3b7ad3f24b04d88a28933b1d1f8286c7 /gcc
parentae3d8837bd4e64b3e0ffc43b2b997248ed5c66e2 (diff)
downloadgcc-93e90bf474fd9410af5127417d542c2f80466ca4.zip
gcc-93e90bf474fd9410af5127417d542c2f80466ca4.tar.gz
gcc-93e90bf474fd9410af5127417d542c2f80466ca4.tar.bz2
[multiple changes]
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog30
-rw-r--r--gcc/ada/a-calend.ads3
-rw-r--r--gcc/ada/a-dispat.ads3
-rw-r--r--gcc/ada/a-reatim.ads3
-rw-r--r--gcc/ada/a-taside.ads3
-rw-r--r--gcc/ada/exp_ch5.adb2
-rw-r--r--gcc/ada/par_sco.adb4
-rw-r--r--gcc/ada/sem_ch13.adb6
-rw-r--r--gcc/ada/sem_ch5.adb15
-rw-r--r--gcc/ada/sem_prag.adb11
-rw-r--r--gcc/ada/sem_res.adb12
-rw-r--r--gcc/ada/sem_util.adb4
12 files changed, 77 insertions, 19 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 93e1eeb..75201ec 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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):
diff --git a/gcc/ada/a-calend.ads b/gcc/ada/a-calend.ads
index d765103..39e9c33 100644
--- a/gcc/ada/a-calend.ads
+++ b/gcc/ada/a-calend.ads
@@ -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;
diff --git a/gcc/ada/a-dispat.ads b/gcc/ada/a-dispat.ads
index a193940..b4e4d03 100644
--- a/gcc/ada/a-dispat.ads
+++ b/gcc/ada/a-dispat.ads
@@ -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;
diff --git a/gcc/ada/a-reatim.ads b/gcc/ada/a-reatim.ads
index 8b341c0..cb84859 100644
--- a/gcc/ada/a-reatim.ads
+++ b/gcc/ada/a-reatim.ads
@@ -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
diff --git a/gcc/ada/a-taside.ads b/gcc/ada/a-taside.ads
index ee39ec3..72467bf 100644
--- a/gcc/ada/a-taside.ads
+++ b/gcc/ada/a-taside.ads
@@ -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
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 25a9fe0..d7a0d9e 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -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))
diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb
index 1aa4bc9..d10e1d2 100644
--- a/gcc/ada/par_sco.adb
+++ b/gcc/ada/par_sco.adb
@@ -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.
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 5fc8304..aa929bd 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -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
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 657a0e4..64b05ff 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -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;
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index d929c85..22daf49 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -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);
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 29c5612..e8495c7 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -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
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index d03eca8..e9e16ae 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -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;