diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2019-08-19 08:36:07 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-08-19 08:36:07 +0000 |
commit | 27b2fbc95cea0512e71a4cd3090e68ae2bf4fe1d (patch) | |
tree | 77ca99a7ab530701448747d6dd1fc47b26f99603 | |
parent | d41f5c1facb17bd231fe4dbc122d105585281487 (diff) | |
download | gcc-27b2fbc95cea0512e71a4cd3090e68ae2bf4fe1d.zip gcc-27b2fbc95cea0512e71a4cd3090e68ae2bf4fe1d.tar.gz gcc-27b2fbc95cea0512e71a4cd3090e68ae2bf4fe1d.tar.bz2 |
[Ada] Fix internal error on subprogram instantiation with -gnatzc
This fixes a fallout of the recent change keeping the
Is_Generic_Instance flag on the wrapper package built for the
instantiation of a generic subprogram.
There is no need to visit the Instance_Spec of an
N_Subprogram_Instantiation node anymore because the regular processing
for an N_Package_Declaration node now does the job for instantiations of
generic subprograms.
The following subprogram must compile again quietly with -gnatzc:
with Gen_Proc;
package RCI is
pragma Remote_Call_Interface;
procedure Inst_Proc is new Gen_Proc;
procedure P (S : String);
end RCI;
generic
procedure Gen_Proc (S : String);
pragma Remote_Call_Interface (Gen_Proc);
with Ada.Text_IO; use Ada.Text_IO;
procedure Gen_Proc (S : String) is
begin
Put_Line ("Gen_Proc called: " & S);
end Gen_Proc;
2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* exp_dist.adb (Build_Package_Stubs): Do not specifically visit
the declarations of an N_Subprogram_Instantiation node.
From-SVN: r274647
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/exp_dist.adb | 16 |
2 files changed, 7 insertions, 14 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f059578..e1342f4 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-08-19 Eric Botcazou <ebotcazou@adacore.com> + + * exp_dist.adb (Build_Package_Stubs): Do not specifically visit + the declarations of an N_Subprogram_Instantiation node. + 2019-08-19 Bob Duff <duff@adacore.com> * doc/gnat_ugn/gnat_utility_programs.rst: Document missing diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb index 13d45ff..4f13d9c 100644 --- a/gcc/ada/exp_dist.adb +++ b/gcc/ada/exp_dist.adb @@ -963,10 +963,8 @@ package body Exp_Dist is when N_Package_Declaration => -- Case of a nested package or package instantiation coming - -- from source. Note that the anonymous wrapper package for - -- subprogram instances is not flagged Is_Generic_Instance at - -- this point, so there is a distinct circuit to handle them - -- (see case N_Subprogram_Instantiation below). + -- from source, including the wrapper package for an instance + -- of a generic subprogram. declare Pkg_Ent : constant Entity_Id := @@ -982,16 +980,6 @@ package body Exp_Dist is end if; end; - when N_Subprogram_Instantiation => - - -- The subprogram declaration for an instance of a generic - -- subprogram is wrapped in a package that does not come from - -- source, so we need to explicitly traverse it here. - - if Comes_From_Source (Decl) then - Visit_Nested_Pkg (Instance_Spec (Decl)); - end if; - when others => null; end case; |