aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2016-04-20 11:14:02 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2016-04-20 11:14:02 +0200
commit31ae1b4629ed84e4dd0ba7ac4f94181ab197041f (patch)
treed671cff63143ce6c618c5b9b30e2b7e5fb3bb45d
parent1ba563f5f9ba42ccbb36f4201bcbbe0c807ae26e (diff)
downloadgcc-31ae1b4629ed84e4dd0ba7ac4f94181ab197041f.zip
gcc-31ae1b4629ed84e4dd0ba7ac4f94181ab197041f.tar.gz
gcc-31ae1b4629ed84e4dd0ba7ac4f94181ab197041f.tar.bz2
[multiple changes]
2016-04-20 Arnaud Charlet <charlet@adacore.com> * snames.ads-tmpl (Internal_Attribute_Id, Attribute_Class_Array): Fix indentation. * sem_util.adb (Is_Unchecked_Conversion_Instance): defense against library-level renamings of other functions, which are never instances of Unchecked_Conversion. * einfo.ads: minor fix of casing in comment 2016-04-20 Ed Schonberg <schonberg@adacore.com> * exp_ch6.adb (Expand_N_Subprogram_Stub): Do not expand a body that has been analyzed and expanded already. Qualify the names in the proper body for use in the generation of C code. From-SVN: r235244
-rw-r--r--gcc/ada/ChangeLog15
-rw-r--r--gcc/ada/einfo.ads4
-rw-r--r--gcc/ada/exp_ch6.adb17
-rw-r--r--gcc/ada/sem_util.adb9
-rw-r--r--gcc/ada/snames.ads-tmpl8
5 files changed, 44 insertions, 9 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 3a856be..fe429f1 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,18 @@
+2016-04-20 Arnaud Charlet <charlet@adacore.com>
+
+ * snames.ads-tmpl (Internal_Attribute_Id, Attribute_Class_Array): Fix
+ indentation.
+ * sem_util.adb (Is_Unchecked_Conversion_Instance):
+ defense against library-level renamings of other functions,
+ which are never instances of Unchecked_Conversion.
+ * einfo.ads: minor fix of casing in comment
+
+2016-04-20 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch6.adb (Expand_N_Subprogram_Stub): Do not expand a body
+ that has been analyzed and expanded already. Qualify the names
+ in the proper body for use in the generation of C code.
+
2016-04-20 Javier Miranda <miranda@adacore.com>
* contracts.adb (Build_Postconditions_Procedure): Force its
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index e0b1f26..e55c676 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -4441,9 +4441,9 @@ package Einfo is
-- protected operation, etc).
-- b) Alias applies to overloadable entities, and the value is an overloadable
--- entity. so this is a subset of the previous one. We use the term Alias to
+-- entity. So this is a subset of the previous one. We use the term Alias to
-- cover both renamings and inherited operations, because both cases are
--- handled in the same way when expanding a call. namely the Alias of a given
+-- handled in the same way when expanding a call. Namely the Alias of a given
-- subprogram is the subprogram that will actually be called.
-- Both a) and b) are set transitively, so that in fact it is not necessary to
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index 5675623..511f479 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -5521,10 +5521,23 @@ package body Exp_Ch6 is
-----------------------------------
procedure Expand_N_Subprogram_Body_Stub (N : Node_Id) is
+ Bod : Node_Id;
begin
if Present (Corresponding_Body (N)) then
- Expand_N_Subprogram_Body (
- Unit_Declaration_Node (Corresponding_Body (N)));
+ Bod := Unit_Declaration_Node (Corresponding_Body (N));
+
+ -- The body may have been expanded already when it is analyzed
+ -- through the subunit node. Do no expand again: it interferes
+ -- with the construction of unnesting tables when generating C.
+
+ if not Analyzed (Bod) then
+ Expand_N_Subprogram_Body (Bod);
+ end if;
+
+ -- Add full qualification to entities that may be created late
+ -- during unnesting.
+
+ Qualify_Entity_Names (N);
end if;
end Expand_N_Subprogram_Body_Stub;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index e9e16ae..4820830 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -14282,6 +14282,7 @@ package body Sem_Util is
--------------------------------------
function Is_Unchecked_Conversion_Instance (Id : Entity_Id) return Boolean is
+ Par : Node_Id;
Gen_Par : Entity_Id;
begin
@@ -14289,7 +14290,13 @@ package body Sem_Util is
-- function Unchecked_Conversion.
if Ekind (Id) = E_Function then
- Gen_Par := Generic_Parent (Parent (Id));
+ Par := Parent (Id);
+
+ if Nkind (Par) /= N_Function_Specification then
+ return False;
+ end if;
+
+ Gen_Par := Generic_Parent (Par);
return
Present (Gen_Par)
diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl
index e52a181..76b353b 100644
--- a/gcc/ada/snames.ads-tmpl
+++ b/gcc/ada/snames.ads-tmpl
@@ -1677,11 +1677,11 @@ package Snames is
Attribute_Dispatching_Domain,
Attribute_Interrupt_Priority);
- subtype Internal_Attribute_Id is Attribute_Id range
- Attribute_CPU .. Attribute_Interrupt_Priority;
+ subtype Internal_Attribute_Id is Attribute_Id range
+ Attribute_CPU .. Attribute_Interrupt_Priority;
- type Attribute_Class_Array is array (Attribute_Id) of Boolean;
- -- Type used to build attribute classification flag arrays
+ type Attribute_Class_Array is array (Attribute_Id) of Boolean;
+ -- Type used to build attribute classification flag arrays
------------------------------------
-- Convention Name ID Definitions --