This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Fix an ICE on instantiated subprogram with -gnatc
- From: Pierre-Marie de Rodat <derodat at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Eric Botcazou <ebotcazou at adacore dot com>
- Date: Tue, 11 Dec 2018 06:31:34 -0500
- Subject: [Ada] Fix an ICE on instantiated subprogram with -gnatc
The following should compile quietly:
$ gcc -c p-proc.ads -gnatc
procedure P.Proc is new G;
with Q;
package P is
generic procedure G;
end P;
with System;
with Unchecked_Conversion;
package Q is
generic package Inner_G is
type T is access all Integer;
function Cnv is new Unchecked_Conversion (System.Address, T);
end Inner_G;
end Q;
Tested on x86_64-pc-linux-gnu, committed on trunk
2018-12-11 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* gcc-interface/trans.c (elaborate_all_entities_for_package):
Skip aliasing subprograms.
--- gcc/ada/gcc-interface/trans.c
+++ gcc/ada/gcc-interface/trans.c
@@ -9278,7 +9278,9 @@ elaborate_all_entities_for_package (Entity_Id gnat_package)
continue;
if (kind == E_Operator)
continue;
- if (IN (kind, Subprogram_Kind) && Is_Intrinsic_Subprogram (gnat_entity))
+ if (IN (kind, Subprogram_Kind)
+ && (Present (Alias (gnat_entity))
+ || Is_Intrinsic_Subprogram (gnat_entity)))
continue;
if (Is_Itype (gnat_entity))
continue;