aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-01-13 11:38:56 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2017-01-13 11:38:56 +0100
commit3abbc5c2409fae926307f5321debdf6191cd2152 (patch)
tree6cacb10c92f95dd2445197b0ae052578e19dcd61
parentef74daead6d1668980566524b3a49dcc8f51295c (diff)
downloadgcc-3abbc5c2409fae926307f5321debdf6191cd2152.zip
gcc-3abbc5c2409fae926307f5321debdf6191cd2152.tar.gz
gcc-3abbc5c2409fae926307f5321debdf6191cd2152.tar.bz2
[multiple changes]
2017-01-13 Yannick Moy <moy@adacore.com> * inline.adb: Code cleanup. * sem_util.adb (Is_OK_Volatile_Context): Add expression in delay statement as OK for volatile context. 2017-01-13 Ed Schonberg <schonberg@adacore.com> * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation mode a choice that is a subtype with a static predicate is replaced by the values it covers. This transformation must not be performed in ASIS mode, to preserve the source for analysis. 2017-01-13 Justin Squirek <squirek@adacore.com> * nlists.ads: Correct minor typo. From-SVN: r244411
-rw-r--r--gcc/ada/ChangeLog17
-rw-r--r--gcc/ada/inline.adb11
-rw-r--r--gcc/ada/nlists.ads4
-rw-r--r--gcc/ada/sem_aggr.adb7
-rw-r--r--gcc/ada/sem_util.adb5
5 files changed, 33 insertions, 11 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 1ec581c..d4e3301 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,20 @@
+2017-01-13 Yannick Moy <moy@adacore.com>
+
+ * inline.adb: Code cleanup.
+ * sem_util.adb (Is_OK_Volatile_Context): Add
+ expression in delay statement as OK for volatile context.
+
+2017-01-13 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_aggr.adb (Resolve_Array_Aggregate): In normal compilation
+ mode a choice that is a subtype with a static predicate is
+ replaced by the values it covers. This transformation must not
+ be performed in ASIS mode, to preserve the source for analysis.
+
+2017-01-13 Justin Squirek <squirek@adacore.com>
+
+ * nlists.ads: Correct minor typo.
+
2017-01-13 Gary Dismukes <dismukes@adacore.com>
* sem_ch13.adb: Minor reformatting and typo fix.
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index 7389105..d0f8a8c 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -3200,17 +3200,12 @@ package body Inline is
then
pragma Assert (not (Is_By_Reference_Type (Etype (A))));
pragma Assert (not (Is_Limited_Type (Etype (A))));
- Decl :=
+ Append_To (Decls,
Make_Object_Declaration (Loc,
- Defining_Identifier => Temp,
+ Defining_Identifier => Make_Temporary (Loc, 'C'),
Constant_Present => True,
Object_Definition => New_Occurrence_Of (Temp_Typ, Loc),
- Expression => New_Copy_Tree (New_A));
- Append (Decl, Decls);
-
- -- Create another name for the renaming
-
- Temp := Make_Temporary (Loc, 'C');
+ Expression => New_Copy_Tree (New_A)));
end if;
Decl :=
diff --git a/gcc/ada/nlists.ads b/gcc/ada/nlists.ads
index 1cdcee6..90d5e7e 100644
--- a/gcc/ada/nlists.ads
+++ b/gcc/ada/nlists.ads
@@ -302,13 +302,13 @@ package Nlists is
-- Like Prepend_List, but arguments are the other way round
procedure Prepend_New (Node : Node_Or_Entity_Id; To : in out List_Id);
- pragma Inline (Append_New);
+ pragma Inline (Prepend_New);
-- Prepends Node at the end of node list To. If To is non-existent list, a
-- list is created. Node must be a non-empty node that is not already a
-- member of a node list, and To must be a node list.
procedure Prepend_New_To (To : in out List_Id; Node : Node_Or_Entity_Id);
- pragma Inline (Append_New_To);
+ pragma Inline (Prepend_New_To);
-- Like Prepend_New, but the arguments are in reverse order
procedure Prepend_To
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 1b9f0af..9481c45 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -1809,8 +1809,13 @@ package body Sem_Aggr is
-- If the subtype has a static predicate, replace the
-- original choice with the list of individual values
-- covered by the predicate.
+ -- Do not perform this transformation if we need to
+ -- preserve the source for ASIS use.
+ -- This should be deferred to expansion time ???
- if Present (Static_Discrete_Predicate (E)) then
+ if Present (Static_Discrete_Predicate (E))
+ and then not ASIS_Mode
+ then
Delete_Choice := True;
New_Cs := New_List;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 3b90fe8..b90b007 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -13726,6 +13726,11 @@ package body Sem_Util is
then
return True;
+ -- The volatile object appears as the expression in a delay statement
+
+ elsif Nkind (Context) in N_Delay_Statement then
+ return True;
+
-- Allow references to volatile objects in various checks. This is not a
-- direct SPARK 2014 requirement.