aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-01-02 10:38:07 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2013-01-02 10:38:07 +0100
commitc5d00db06fdfa662780ddbb179a684e221655b34 (patch)
tree3810f64351197f20c896eb6cb7beebeef3afda79
parent39ce7604727100ff8abd1e5513a303b6df499b7a (diff)
downloadgcc-c5d00db06fdfa662780ddbb179a684e221655b34.zip
gcc-c5d00db06fdfa662780ddbb179a684e221655b34.tar.gz
gcc-c5d00db06fdfa662780ddbb179a684e221655b34.tar.bz2
[multiple changes]
2013-01-02 Thomas Quinot <quinot@adacore.com> * exp_prag.adb (Expand_Pragma_Check): The statements generated for the pragma must have the sloc of the pragma, not the sloc of the condition, otherwise this creates anomalies in the generated debug information that confuse coverage analysis tools. 2013-01-02 Thomas Quinot <quinot@adacore.com> * sem_ch13.adb: Minor reformatting. 2013-01-02 Arnaud Charlet <charlet@adacore.com> * g-excact.ads (Core_Dump): Clarify that this subprogram does not dump cores under Windows. 2013-01-02 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Analyze_Primitive_Renamed_Operation): The prefixed view of a subprogram has convention Intrnnsic, and a renaming of a prefixed view cannot be the prefix of an Access attribute. 2013-01-02 Robert Dewar <dewar@adacore.com> * restrict.adb: Minor reformatting. From-SVN: r194782
-rw-r--r--gcc/ada/ChangeLog26
-rw-r--r--gcc/ada/exp_prag.adb26
-rw-r--r--gcc/ada/g-excact.ads8
-rw-r--r--gcc/ada/restrict.adb4
-rw-r--r--gcc/ada/sem_ch13.adb6
-rw-r--r--gcc/ada/sem_ch8.adb20
6 files changed, 71 insertions, 19 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 7d79a90..e92b0d7 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,31 @@
2013-01-02 Thomas Quinot <quinot@adacore.com>
+ * exp_prag.adb (Expand_Pragma_Check): The statements generated
+ for the pragma must have the sloc of the pragma, not the
+ sloc of the condition, otherwise this creates anomalies in the
+ generated debug information that confuse coverage analysis tools.
+
+2013-01-02 Thomas Quinot <quinot@adacore.com>
+
+ * sem_ch13.adb: Minor reformatting.
+
+2013-01-02 Arnaud Charlet <charlet@adacore.com>
+
+ * g-excact.ads (Core_Dump): Clarify that this subprogram does
+ not dump cores under Windows.
+
+2013-01-02 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb (Analyze_Primitive_Renamed_Operation): The prefixed
+ view of a subprogram has convention Intrnnsic, and a renaming
+ of a prefixed view cannot be the prefix of an Access attribute.
+
+2013-01-02 Robert Dewar <dewar@adacore.com>
+
+ * restrict.adb: Minor reformatting.
+
+2013-01-02 Thomas Quinot <quinot@adacore.com>
+
* exp_prag.adb: Minor reformatting.
2013-01-02 Ed Schonberg <schonberg@adacore.com>
diff --git a/gcc/ada/exp_prag.adb b/gcc/ada/exp_prag.adb
index 9ff1318..f607b37 100644
--- a/gcc/ada/exp_prag.adb
+++ b/gcc/ada/exp_prag.adb
@@ -274,18 +274,18 @@ package body Exp_Prag is
--------------------------
procedure Expand_Pragma_Check (N : Node_Id) is
+ Loc : constant Source_Ptr := Sloc (N);
+ -- Location of the pragma node. Note: it is important to use this
+ -- location (and not the location of the expression) for the generated
+ -- statements, otherwise the implicit return statement in the body
+ -- of a pre/postcondition subprogram may inherit the source location
+ -- of part of the expression, which causes confusing debug information
+ -- to be generated, which interferes with coverage analysis tools.
+
Cond : constant Node_Id := Arg2 (N);
Nam : constant Name_Id := Chars (Arg1 (N));
Msg : Node_Id;
- Loc : constant Source_Ptr := Sloc (First_Node (Cond));
- -- Source location used in the case of a failed assertion. Note that
- -- the source location of the expression is not usually the best choice
- -- here. For example, it gets located on the last AND keyword in a
- -- chain of boolean expressiond AND'ed together. It is best to put the
- -- message on the first character of the assertion, which is the effect
- -- of the First_Node call here.
-
begin
-- We already know that this check is enabled, because otherwise the
-- semantic pass dealt with rewriting the assertion (see Sem_Prag)
@@ -362,7 +362,15 @@ package body Exp_Prag is
else
declare
- Msg_Loc : constant String := Build_Location_String (Loc);
+ Msg_Loc : constant String :=
+ Build_Location_String (Sloc (First_Node (Cond)));
+ -- Source location used in the case of a failed assertion:
+ -- point to the failing condition, not Loc. Note that the
+ -- source location of the expression is not usually the best
+ -- choice here. For example, it gets located on the last AND
+ -- keyword in a chain of boolean expressiond AND'ed together.
+ -- It is best to put the message on the first character of the
+ -- condition, which is the effect of the First_Node call here.
begin
Name_Len := 0;
diff --git a/gcc/ada/g-excact.ads b/gcc/ada/g-excact.ads
index 77abada..6111bc7 100644
--- a/gcc/ada/g-excact.ads
+++ b/gcc/ada/g-excact.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2002-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-2012, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -110,7 +110,9 @@ package GNAT.Exception_Actions is
-- is compiled with pragma Restrictions (No_Exception_Registration);
procedure Core_Dump (Occurrence : Exception_Occurrence);
- -- Dump memory (called a core dump in some systems), and abort execution
- -- of the application.
+ -- Dump memory (called a core dump in some systems) if supported by the
+ -- OS (most unix systems and VMS), and abort execution of the application.
+ -- Under Windows this procedure will not dump the memory, it will only
+ -- abort execution.
end GNAT.Exception_Actions;
diff --git a/gcc/ada/restrict.adb b/gcc/ada/restrict.adb
index 14ab452..84e576b 100644
--- a/gcc/ada/restrict.adb
+++ b/gcc/ada/restrict.adb
@@ -611,8 +611,8 @@ package body Restrict is
end if;
-- Ignore call if node N is not in the main source unit, since we only
- -- give messages for . This avoids giving messages for aspects that are
- -- specified in withed units.
+ -- give messages for the main unit. This avoids giving messages for
+ -- aspects that are specified in withed units.
if not In_Extended_Main_Source_Unit (N) then
return;
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index a959e51..235af18 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -1886,7 +1886,7 @@ package body Sem_Ch13 is
-- In the context of a compilation unit, we directly put the
-- pragma in the Pragmas_After list of the
- -- N_Compilation_Unit_Aux node (No delay is required here)
+ -- N_Compilation_Unit_Aux node (no delay is required here)
-- except for aspects on a subprogram body (see below).
if Nkind (Parent (N)) = N_Compilation_Unit
@@ -2012,8 +2012,8 @@ package body Sem_Ch13 is
Rewrite (N,
Make_Attribute_Definition_Clause (Sloc (N),
- Name => Identifier (N),
- Chars => Name_Address,
+ Name => Identifier (N),
+ Chars => Name_Address,
Expression => Expression (N)));
-- We preserve Comes_From_Source, since logically the clause still comes
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index ae12e46..5564dcc 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -397,8 +397,10 @@ package body Sem_Ch8 is
New_S : Entity_Id;
Is_Body : Boolean);
-- If the renamed entity in a subprogram renaming is a primitive operation
- -- or a class-wide operation in prefix form, save the target object, which
- -- must be added to the list of actuals in any subsequent call.
+ -- or a class-wide operation in prefix form, save the target object,
+ -- which must be added to the list of actuals in any subsequent call.
+ -- The renaming operation is intrinsic because the compiler must in
+ -- fact generate a wrapper for it (6.3.1 (10 1/2)).
function Applicable_Use (Pack_Name : Node_Id) return Boolean;
-- Common code to Use_One_Package and Set_Use, to determine whether use
@@ -1602,6 +1604,10 @@ package body Sem_Ch8 is
-- match. The first formal of the renamed entity is skipped because it
-- is the target object in any subsequent call.
+ --------------
+ -- Conforms --
+ --------------
+
function Conforms
(Subp : Entity_Id;
Ctyp : Conformance_Type) return Boolean
@@ -1634,6 +1640,8 @@ package body Sem_Ch8 is
return True;
end Conforms;
+ -- Start of processing for Analyze_Renamed_Primitive_Operation
+
begin
if not Is_Overloaded (Selector_Name (Name (N))) then
Old_S := Entity (Selector_Name (Name (N)));
@@ -1681,6 +1689,14 @@ package body Sem_Ch8 is
if not Conforms (Old_S, Mode_Conformant) then
Error_Msg_N ("mode conformance error in renaming", N);
end if;
+
+ -- Enforce the rule given in (RM 6.3.1 (10.1/2)): a prefixed
+ -- view of a subprogram is intrinsic, because the compiler has
+ -- to generate a wrapper for any call to it. If the name in a
+ -- subprogram renaming is a prefixed view, the entity is thus
+ -- intrinsic, and 'Access cannot be applied to it.
+
+ Set_Convention (New_S, Convention_Intrinsic);
end if;
-- Inherit_Renamed_Profile (New_S, Old_S);