https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123060
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
CC| |ebotcazou at gcc dot gnu.org
Last reconfirmed| |2025-12-11
--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
This boils down to:
package P is
type Rec is private;
type Ptr is access all Rec;
procedure Proc;
private
type Rec is null record;
end P;
with Ada.Unchecked_Conversion;
with System;
package body P is
generic
type T is private;
package Unbounded_Arrays is
type Unbounded_Array is array (Natural range 1 .. Natural'Last) of T;
type Unbounded_Array_Access is access Unbounded_Array;
function Convert is new
Ada.Unchecked_Conversion (System.Address, Unbounded_Array_Access);
end Unbounded_Arrays;
package Atom_Arrays is new Unbounded_Arrays (Ptr);
use Atom_Arrays;
procedure Proc is
procedure Foo (Targets : access Unbounded_Array_Access);
pragma Import (Ada, Foo, "Foo");
Output : aliased Unbounded_Array_Access;
begin
Foo (Output'Unchecked_Access);
end;
end P;
eric@fomalhaut:~/build/gcc/native/tmp> gcc -c p.adb -flto
during IPA pass: *free_lang_data
+===========================GNAT BUG DETECTED==============================+
| 16.0.0 20251211 (experimental) [master r16-6029-g8f36f3944bf]
(x86_64-suse-linux) GCC error:|
| in fld_incomplete_type_of, at ipa-free-lang-data.cc:262 |
| Error detected around p.adb:28:1 |
| Compiling p.adb |