aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2016-04-20 12:10:32 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2016-04-20 12:10:32 +0200
commit7e22a38c2f5f173ac220cd9ec70b55ce08243797 (patch)
tree918e410cb893da0e81e3563fff774beb29062ae6
parentb83dd5ecea2899fc6220aa8be8f999ed61a6b62f (diff)
downloadgcc-7e22a38c2f5f173ac220cd9ec70b55ce08243797.zip
gcc-7e22a38c2f5f173ac220cd9ec70b55ce08243797.tar.gz
gcc-7e22a38c2f5f173ac220cd9ec70b55ce08243797.tar.bz2
[multiple changes]
2016-04-20 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Rep_Item_Too_Late): Better error message for an illegal aspect that freezes the entity to which it applies. 2016-04-20 Bob Duff <duff@adacore.com> * a-stwibo.ads, a-stzbou.ads ("="): Add overriding keyword before function to avoid crash when compiler is called with -gnatyO (check overriding indicators). 2016-04-20 Ed Schonberg <schonberg@adacore.com> * sem_prag.adb (Analyze_Pragma, case Check_Policy): If this is a configuration pragma and it uses the ARG syntax, insert the rewritten pragma after the current one rather than using Insert_Actions. 2016-04-20 Arnaud Charlet <charlet@adacore.com> * exp_aggr.adb (Backend_Processing_Possible): Add handling of C back-end. From-SVN: r235253
-rw-r--r--gcc/ada/ChangeLog23
-rw-r--r--gcc/ada/a-stwibo.ads4
-rw-r--r--gcc/ada/a-stzbou.ads4
-rw-r--r--gcc/ada/exp_aggr.adb13
-rw-r--r--gcc/ada/sem_ch13.adb12
-rw-r--r--gcc/ada/sem_prag.adb22
6 files changed, 69 insertions, 9 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 1c07d5e..c6f1e67 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,26 @@
+2016-04-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch13.adb (Rep_Item_Too_Late): Better error message for
+ an illegal aspect that freezes the entity to which it applies.
+
+2016-04-20 Bob Duff <duff@adacore.com>
+
+ * a-stwibo.ads, a-stzbou.ads
+ ("="): Add overriding keyword before function to avoid crash when
+ compiler is called with -gnatyO (check overriding indicators).
+
+2016-04-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma, case Check_Policy): If this
+ is a configuration pragma and it uses the ARG syntax, insert
+ the rewritten pragma after the current one rather than using
+ Insert_Actions.
+
+2016-04-20 Arnaud Charlet <charlet@adacore.com>
+
+ * exp_aggr.adb (Backend_Processing_Possible): Add handling of
+ C back-end.
+
2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
* s-imgllu.adb, sem_util.adb, s-imgint.adb, s-imguns.adb,
diff --git a/gcc/ada/a-stwibo.ads b/gcc/ada/a-stwibo.ads
index c5a54d1..3d098b3 100644
--- a/gcc/ada/a-stwibo.ads
+++ b/gcc/ada/a-stwibo.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -609,7 +609,7 @@ package Ada.Strings.Wide_Bounded is
High : Natural)
renames Super_Slice;
- function "="
+ overriding function "="
(Left : Bounded_Wide_String;
Right : Bounded_Wide_String) return Boolean
renames Equal;
diff --git a/gcc/ada/a-stzbou.ads b/gcc/ada/a-stzbou.ads
index 9574802..d7d3f52 100644
--- a/gcc/ada/a-stzbou.ads
+++ b/gcc/ada/a-stzbou.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -618,7 +618,7 @@ package Ada.Strings.Wide_Wide_Bounded is
High : Natural)
renames Super_Slice;
- function "="
+ overriding function "="
(Left : Bounded_Wide_Wide_String;
Right : Bounded_Wide_Wide_String) return Boolean
renames Equal;
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 94f8e07..bd757cd 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -545,6 +545,8 @@ package body Exp_Aggr is
-- 10. No controlled actions need to be generated for components
+ -- 11. When generating C code, N must be part of a N_Object_Declaration
+
function Backend_Processing_Possible (N : Node_Id) return Boolean is
Typ : constant Entity_Id := Etype (N);
-- Typ is the correct constrained array subtype of the aggregate
@@ -569,6 +571,17 @@ package body Exp_Aggr is
return False;
end if;
+ -- Checks 11: (part of an object declaration)
+
+ if Generate_C_Code
+ and then Nkind (Parent (N)) /= N_Object_Declaration
+ and then
+ (Nkind (Parent (N)) /= N_Qualified_Expression
+ or else Nkind (Parent (Parent (N))) /= N_Object_Declaration)
+ then
+ return False;
+ end if;
+
-- Checks on components
-- Recurse to check subaggregates, which may appear in qualified
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index aa929bd..77909a6 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -12286,6 +12286,18 @@ package body Sem_Ch13 is
and then Comes_From_Source (T)
then
+ -- A self-referential aspect is illegal if it forces freezing the
+ -- entity before the corresponding pragma has been analyzed.
+
+ if Nkind_In (N, N_Attribute_Definition_Clause, N_Pragma)
+ and then From_Aspect_Specification (N)
+ then
+ Error_Msg_NE
+ ("aspect specification causes premature freezing of&", T, N);
+ Set_Has_Delayed_Freeze (T, False);
+ return True;
+ end if;
+
Too_Late;
S := First_Subtype (T);
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 22daf49..c538caf 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -12504,9 +12504,10 @@ package body Sem_Prag is
else
declare
- Arg : Node_Id;
- Argx : Node_Id;
- LocP : Source_Ptr;
+ Arg : Node_Id;
+ Argx : Node_Id;
+ LocP : Source_Ptr;
+ New_P : Node_Id;
begin
Arg := Arg1;
@@ -12526,7 +12527,7 @@ package body Sem_Prag is
-- Construct equivalent old form syntax Check_Policy
-- pragma and insert it to get remaining checks.
- Insert_Action (N,
+ New_P :=
Make_Pragma (LocP,
Chars => Name_Check_Policy,
Pragma_Argument_Associations => New_List (
@@ -12534,9 +12535,20 @@ package body Sem_Prag is
Expression =>
Make_Identifier (LocP, Chars (Arg))),
Make_Pragma_Argument_Association (Sloc (Argx),
- Expression => Argx))));
+ Expression => Argx)));
Arg := Next (Arg);
+
+ -- For a configuration pragma, insert old form in
+ -- the corresponding file.
+
+ if Is_Configuration_Pragma then
+ Insert_After (N, New_P);
+ Analyze (New_P);
+
+ else
+ Insert_Action (N, New_P);
+ end if;
end loop;
-- Rewrite original Check_Policy pragma to null, since we