aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-10-20 12:00:15 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2015-10-20 12:00:15 +0200
commit47b79f7801556cc194b099d5bad6409c93cf599c (patch)
treea46cc1b345b5b36131aaf156511be52f5bb1358a /gcc/ada
parente9f97e793186e04e2a69ef8dc15073b530f2851f (diff)
downloadgcc-47b79f7801556cc194b099d5bad6409c93cf599c.zip
gcc-47b79f7801556cc194b099d5bad6409c93cf599c.tar.gz
gcc-47b79f7801556cc194b099d5bad6409c93cf599c.tar.bz2
[multiple changes]
2015-10-20 Gary Dismukes <dismukes@adacore.com> * sem_ch13.adb: Minor reference change (RM => AARM). 2015-10-20 Eric Botcazou <ebotcazou@adacore.com> * make.adb (Check): Skip multilib switches reinstated by the compiler only when counting the number of switches, since it is what really matters in the regular operating mode. 2015-10-20 Arnaud Charlet <charlet@adacore.com> * einfo.adb: Add extra assertion for small clause. * cstand.adb: Minor style fix in comment. * debug.adb: Minor reformatting. * exp_util.adb: Fix minor typo. 2015-10-20 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Same_Instantiated_Function): New predicate in Check_Formal_Package_Instance, used to verify that the formal and the actual of an actual package match when both are functions given as attribute references. From-SVN: r229034
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog24
-rw-r--r--gcc/ada/cstand.adb4
-rw-r--r--gcc/ada/debug.adb4
-rw-r--r--gcc/ada/einfo.adb2
-rw-r--r--gcc/ada/exp_util.adb2
-rw-r--r--gcc/ada/make.adb52
-rw-r--r--gcc/ada/sem_ch12.adb37
-rw-r--r--gcc/ada/sem_ch13.adb2
8 files changed, 100 insertions, 27 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 81f6512..e285e66 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,27 @@
+2015-10-20 Gary Dismukes <dismukes@adacore.com>
+
+ * sem_ch13.adb: Minor reference change (RM => AARM).
+
+2015-10-20 Eric Botcazou <ebotcazou@adacore.com>
+
+ * make.adb (Check): Skip multilib switches reinstated by the
+ compiler only when counting the number of switches, since it is
+ what really matters in the regular operating mode.
+
+2015-10-20 Arnaud Charlet <charlet@adacore.com>
+
+ * einfo.adb: Add extra assertion for small clause.
+ * cstand.adb: Minor style fix in comment.
+ * debug.adb: Minor reformatting.
+ * exp_util.adb: Fix minor typo.
+
+2015-10-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch12.adb (Same_Instantiated_Function): New predicate in
+ Check_Formal_Package_Instance, used to verify that the formal
+ and the actual of an actual package match when both are functions
+ given as attribute references.
+
2015-10-20 Bob Duff <duff@adacore.com>
* a-coinve.ads, a-coinve.adb: Do the same efficiency
diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb
index da30887..3d627c8 100644
--- a/gcc/ada/cstand.adb
+++ b/gcc/ada/cstand.adb
@@ -1425,8 +1425,8 @@ package body CStand is
Dhi := Intval (Type_High_Bound (Standard_Integer_32));
Delta_Val := UR_From_Components (UI_From_Int (20), Uint_3, 10);
- -- In standard 64-bit mode, the size is 64-bits and the delta and
- -- small values are set to nanoseconds (1.0*(10.0**(-9))
+ -- In 64-bit mode, the size is 64-bits and the delta and
+ -- small values are set to nanoseconds (1.0*(10.0**(-9)).
else
Dlo := Intval (Type_Low_Bound (Standard_Integer_64));
diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index 2bc09db..0ee0a98 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -694,8 +694,8 @@ package body Debug is
-- d.X A previous version of GNAT allowed indexing aspects to be redefined
-- on derived container types, while the default iterator was
- -- inherited from the aprent type. This non-standard extension is
- -- preserved temporarily for use by the modelling project under debug
+ -- inherited from the parent type. This nonstandard extension is
+ -- preserved temporarily for use by the modeling project under debug
-- flag d.X.
-- d.Z Normally we always enable expansion in configurable run-time mode
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index 8888d77..4e5d083 100644
--- a/gcc/ada/einfo.adb
+++ b/gcc/ada/einfo.adb
@@ -1763,6 +1763,7 @@ package body Einfo is
function Has_Small_Clause (Id : E) return B is
begin
+ pragma Assert (Is_Ordinary_Fixed_Point_Type (Id));
return Flag67 (Id);
end Has_Small_Clause;
@@ -4663,6 +4664,7 @@ package body Einfo is
procedure Set_Has_Small_Clause (Id : E; V : B := True) is
begin
+ pragma Assert (Is_Ordinary_Fixed_Point_Type (Id));
Set_Flag67 (Id, V);
end Set_Has_Small_Clause;
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 56f9b9a..2ff6d5c 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -206,7 +206,7 @@ package body Exp_Util is
end case;
-- Nothing to do for the identifier in an object renaming declaration,
- -- the renaming itself does not need atomic syncrhonization.
+ -- the renaming itself does not need atomic synchronization.
if Nkind (Parent (N)) = N_Object_Renaming_Declaration then
return;
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 8db2598..e368a9f 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -1572,12 +1572,21 @@ package body Make is
Source_Name : File_Name_Type;
Text : Text_Buffer_Ptr;
- Prev_Switch : String_Access;
- -- Previous switch processed
+ First_Arg : Arg_Id;
+ -- Index of the first argument in Args.Table for a given unit
+
+ Last_Arg : Arg_Id;
+ -- Index of the last argument in Args.Table for a given unit
Arg : Arg_Id := Arg_Id'First;
-- Current index in Args.Table for a given unit (init to stop warning)
+ Number_Of_Switches : Natural;
+ -- Number of switches recorded for a given unit
+
+ Prev_Switch : String_Access;
+ -- Previous switch processed
+
Switch_Found : Boolean;
-- True if a given switch has been found
@@ -1720,17 +1729,12 @@ package body Make is
for J in 1 .. Last_Argument loop
- -- Skip -c, -I and -o switches, as well as multilib switches
- -- reinstated by the compiler according to lang-specs.h.
+ -- Skip -c, -I and -o switches
if Arguments (J) (1) = '-'
and then Arguments (J) (2) /= 'c'
and then Arguments (J) (2) /= 'o'
and then Arguments (J) (2) /= 'I'
- and then not (Arguments (J)'Length = 5
- and then Arguments (J) (2 .. 5) = "mrtp")
- and then not (Arguments (J)'Length = 6
- and then Arguments (J) (2 .. 6) = "fsjlj")
then
Normalize_Compiler_Switches
(Arguments (J).all,
@@ -1745,6 +1749,9 @@ package body Make is
end if;
end loop;
+ First_Arg := Units.Table (ALIs.Table (ALI).First_Unit).First_Arg;
+ Last_Arg := Units.Table (ALIs.Table (ALI).First_Unit).Last_Arg;
+
for J in 1 .. Switches_To_Check.Last loop
-- Comparing switches is delicate because gcc reorders a number
@@ -1762,15 +1769,12 @@ package body Make is
Prev_Switch (6) /= Switches_To_Check.Table (J) (6))
then
Prev_Switch := Switches_To_Check.Table (J);
- Arg :=
- Units.Table (ALIs.Table (ALI).First_Unit).First_Arg;
+ Arg := First_Arg;
end if;
Switch_Found := False;
- for K in Arg ..
- Units.Table (ALIs.Table (ALI).First_Unit).Last_Arg
- loop
+ for K in Arg .. Last_Arg loop
if
Switches_To_Check.Table (J).all = Args.Table (K).all
then
@@ -1792,17 +1796,25 @@ package body Make is
end if;
end loop;
- if Switches_To_Check.Last /=
- Integer (Units.Table (ALIs.Table (ALI).First_Unit).Last_Arg -
- Units.Table (ALIs.Table (ALI).First_Unit).First_Arg + 1)
- then
+ Number_Of_Switches := Natural (Last_Arg - First_Arg + 1);
+
+ -- Do not count the multilib switches reinstated by the compiler
+ -- according to the lang-specs.h.settings.
+
+ for K in First_Arg .. Last_Arg loop
+ if Args.Table (K).all = "-mrtp"
+ or else Args.Table (K).all = "-fsjlj"
+ then
+ Number_Of_Switches := Number_Of_Switches - 1;
+ end if;
+ end loop;
+
+ if Switches_To_Check.Last /= Number_Of_Switches then
if Verbose_Mode then
Verbose_Msg (ALIs.Table (ALI).Sfile,
"different number of switches");
- for K in Units.Table (ALIs.Table (ALI).First_Unit).First_Arg
- .. Units.Table (ALIs.Table (ALI).First_Unit).Last_Arg
- loop
+ for K in First_Arg .. Last_Arg loop
Write_Str (Args.Table (K).all);
Write_Char (' ');
end loop;
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 6bcecf4..d546a48 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -5759,6 +5759,11 @@ package body Sem_Ch12 is
-- same entity we may have to traverse several definitions to recover
-- the ultimate entity that they refer to.
+ function Same_Instantiated_Function (E1, E2 : Entity_Id) return Boolean;
+ -- The formal and the actual must be identical, but if both are
+ -- given by attributes they end up renaming different generated bodies,
+ -- and we must verify that the attributes themselves match.
+
function Same_Instantiated_Variable (E1, E2 : Entity_Id) return Boolean;
-- Similarly, if the formal comes from a nested formal package, the
-- actual may designate the formal through multiple renamings, which
@@ -5834,6 +5839,35 @@ package body Sem_Ch12 is
end Same_Instantiated_Constant;
--------------------------------
+ -- Same_Instantiated_Function --
+ --------------------------------
+
+ function Same_Instantiated_Function
+ (E1, E2 : Entity_Id) return Boolean
+ is
+ U1, U2 : Node_Id;
+ begin
+ if Alias (E1) = Alias (E2) then
+ return True;
+
+ elsif Present (Alias (E2)) then
+ U1 := Original_Node (Unit_Declaration_Node (E1));
+ U2 := Original_Node (Unit_Declaration_Node (Alias (E2)));
+
+ return Nkind (U1) = N_Subprogram_Renaming_Declaration
+ and then Nkind (Name (U1)) = N_Attribute_Reference
+
+ and then Nkind (U2) = N_Subprogram_Renaming_Declaration
+ and then Nkind (Name (U2)) = N_Attribute_Reference
+
+ and then
+ Attribute_Name (Name (U1)) = Attribute_Name (Name (U2));
+ else
+ return False;
+ end if;
+ end Same_Instantiated_Function;
+
+ --------------------------------
-- Same_Instantiated_Variable --
--------------------------------
@@ -6050,7 +6084,8 @@ package body Sem_Ch12 is
else
Check_Mismatch
- (Ekind (E2) /= Ekind (E1) or else (Alias (E1)) /= Alias (E2));
+ (Ekind (E2) /= Ekind (E1)
+ or else not Same_Instantiated_Function (E1, E2));
end if;
else
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 7ef0c10..0c3ff28 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -11420,7 +11420,7 @@ package body Sem_Ch13 is
Id : constant Attribute_Id := Get_Attribute_Id (Chars (N));
begin
- -- List of operational items is given in RM 13.1(8.mm/1).
+ -- List of operational items is given in AARM 13.1(8.mm/1).
-- It is clearly incomplete, as it does not include iterator
-- aspects, among others.