aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-08-01 12:22:23 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-08-01 12:22:23 +0200
commit885e570af17aed5736e4fd92347ca05e3d552926 (patch)
tree74e080d6f5d9d9dcb2acbfc07000d7befe7fd6b5 /gcc/ada
parent8894aa20ff573ed8cc3d317199fbcbfbcd03c159 (diff)
downloadgcc-885e570af17aed5736e4fd92347ca05e3d552926.zip
gcc-885e570af17aed5736e4fd92347ca05e3d552926.tar.gz
gcc-885e570af17aed5736e4fd92347ca05e3d552926.tar.bz2
[multiple changes]
2014-08-01 Robert Dewar <dewar@adacore.com> * sem_prag.adb: Minor reformatting. * s-regpat.adb: Minor reformatting. * sem_ch3.adb (Analyze_Object_Declaration): Do not set Treat_As_Volatile on constants. 2014-08-01 Tristan Gingold <gingold@adacore.com> * exp_ch9.adb (Make_Task_Create_Call): Improve error message. 2014-08-01 Ed Schonberg <schonberg@adacore.com> * sem_ch10.adb (Analyze_Compilation_Unit): Do not place a warning on a with_clause created for the renaming of a parent unit in an explicit with_clause. From-SVN: r213448
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog17
-rw-r--r--gcc/ada/exp_ch9.adb14
-rw-r--r--gcc/ada/s-regpat.adb23
-rw-r--r--gcc/ada/sem_ch10.adb6
-rw-r--r--gcc/ada/sem_ch3.adb9
-rw-r--r--gcc/ada/sem_prag.adb3
6 files changed, 58 insertions, 14 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 7f19085..d5606e6 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,20 @@
+2014-08-01 Robert Dewar <dewar@adacore.com>
+
+ * sem_prag.adb: Minor reformatting.
+ * s-regpat.adb: Minor reformatting.
+ * sem_ch3.adb (Analyze_Object_Declaration): Do not set
+ Treat_As_Volatile on constants.
+
+2014-08-01 Tristan Gingold <gingold@adacore.com>
+
+ * exp_ch9.adb (Make_Task_Create_Call): Improve error message.
+
+2014-08-01 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch10.adb (Analyze_Compilation_Unit): Do not place a
+ warning on a with_clause created for the renaming of a parent
+ unit in an explicit with_clause.
+
2014-08-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications, case Aspect_Import):
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index d01e849..3cacc77 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -14013,6 +14013,20 @@ package body Exp_Ch9 is
Ttyp := Corresponding_Concurrent_Type (Task_Rec);
Tnam := Chars (Ttyp);
+ -- The sequential partition elaboration policy is supported only in the
+ -- restricted profile.
+
+ -- This test should be in sem_ch9, not here ???
+
+ if Partition_Elaboration_Policy = 'S'
+ and then not Restricted_Profile
+ then
+ Error_Msg_N
+ ("sequential elaboration supported only in restricted profile",
+ Task_Rec);
+ return Make_Null_Statement (Loc);
+ end if;
+
-- Get task declaration. In the case of a task type declaration, this is
-- simply the parent of the task type entity. In the single task
-- declaration, this parent will be the implicit type, and we can find
diff --git a/gcc/ada/s-regpat.adb b/gcc/ada/s-regpat.adb
index 842b6e3..add78bd 100644
--- a/gcc/ada/s-regpat.adb
+++ b/gcc/ada/s-regpat.adb
@@ -414,9 +414,9 @@ package body System.Regpat is
Flags : out Expression_Flags;
IP : out Pointer);
-- Parse regular expression, i.e. main body or parenthesized thing
- -- Caller must absorb opening parenthesis.
- -- Capturing should be set to True when we have an open parenthesis
- -- from which we want the user to extra text.
+ -- Caller must absorb opening parenthesis. Capturing should be set to
+ -- True when we have an open parenthesis from which we want the user
+ -- to extra text.
procedure Parse_Branch
(Flags : out Expression_Flags;
@@ -920,10 +920,13 @@ package body System.Regpat is
Ender := Emit_Node (CLOSE);
Emit (Character'Val (Par_No));
Link_Tail (IP, Ender);
+
else
- -- need to keep looking after the closing parenthesis
+ -- Need to keep looking after the closing parenthesis
+
null;
end if;
+
else
Ender := Emit_Node (EOP);
Link_Tail (IP, Ender);
@@ -1012,14 +1015,18 @@ package body System.Regpat is
begin
if Parse_Pos <= Parse_End - 1
- and then Expression (Parse_Pos) = '?'
- and then Expression (Parse_Pos + 1) = ':'
+ and then Expression (Parse_Pos) = '?'
+ and then Expression (Parse_Pos + 1) = ':'
then
Parse_Pos := Parse_Pos + 2;
- -- non-capturing parenthesis
+
+ -- Non-capturing parenthesis
+
Parse (True, False, New_Flags, IP);
+
else
- -- capturing parenthesis
+ -- Capturing parenthesis
+
Parse (True, True, New_Flags, IP);
Expr_Flags.Has_Width :=
Expr_Flags.Has_Width or else New_Flags.Has_Width;
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 3fe718b..13deef6 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -242,7 +242,7 @@ package body Sem_Ch10 is
-- on the context. Note that in contrast with the handling of private
-- types, the limited view and the non-limited view of a type are treated
-- as separate entities, and no entity exchange needs to take place, which
- -- makes the implementation must simpler than could be feared.
+ -- makes the implementation much simpler than could be feared.
------------------------------
-- Analyze_Compilation_Unit --
@@ -507,11 +507,15 @@ package body Sem_Ch10 is
-- Avoid checking implicitly generated with clauses, limited with
-- clauses or withs that have pragma Elaborate or Elaborate_All.
+ -- With_clauses introduced for renamings of parent clauses are not
+ -- marked implicit because they need to be properly installed, but
+ -- they do not come from source and do not require warnings.
if Nkind (Clause) = N_With_Clause
and then not Implicit_With (Clause)
and then not Limited_Present (Clause)
and then not Elaborate_Present (Clause)
+ and then Comes_From_Source (Clause)
then
-- Package body-to-spec check
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index e9f3061..adbfd50 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -3923,10 +3923,13 @@ package body Sem_Ch3 is
Set_Etype (Id, Act_T);
- -- Object is marked to be treated as volatile if type is volatile and
- -- we clear the Current_Value setting that may have been set above.
+ -- Non-constant object is marked to be treated as volatile if type is
+ -- volatile and we clear the Current_Value setting that may have been
+ -- set above. Doing so for constants isn't required and might interfere
+ -- with possible uses of the object as a static expression in contexts
+ -- incompatible with volatility (e.g. as a case-statement alternative).
- if Treat_As_Volatile (Etype (Id)) then
+ if Ekind (Id) /= E_Constant and then Treat_As_Volatile (Etype (Id)) then
Set_Treat_As_Volatile (Id);
Set_Current_Value (Id, Empty);
end if;
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index ea74779..3aef372 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -7841,8 +7841,7 @@ package body Sem_Prag is
and then Comes_From_Source
(Original_Node (Expression (Parent (Def_Id))))
then
-
- -- Set imported flag to prevent cascaded errors.
+ -- Set imported flag to prevent cascaded errors
Set_Is_Imported (Def_Id);