This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]