From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8B62C3858D38; Sat, 13 Apr 2024 01:28:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B62C3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712971695; bh=QAmWiB7ISwlEYvqn4eLKnNk9QMg5WtPwGuHxfyexGWE=; h=From:To:Subject:Date:From; b=QRjFYUqGEmoz6bVyNyGrwG0dUdzOAeOyWR9HNRXC53siezJ0dnG4n2x+54t9fK5wr HEAeStHqqp3qMbLOv2/U3hSw17lhIrUIHP2q12wNwfna1aMAoDiZQ7xmSSt8Jqd4q/ wDSdTidpNrzGPyiLZdMNZ+emI+PPt8CWRGwRXCcM= From: "jhb.chat at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/114708] New: Creating access to an incomplete formal in a generic package sometimes causes GNAT to crash Date: Sat, 13 Apr 2024 01:28:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jhb.chat at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114708 Bug ID: 114708 Summary: Creating access to an incomplete formal in a generic package sometimes causes GNAT to crash Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: jhb.chat at gmail dot com CC: dkm at gcc dot gnu.org Target Milestone: --- Created attachment 57939 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D57939&action=3Dedit incomplete formal example When making a generic package that takes an incomplete formal as a parameter and then creating an access type to that formal type inside the generic, GN= AT will crash if an actual incomplete type is supplied in the generic instantiation. This happens on gnat 13.0, on mwys2, Windows 10 Home, fully patched GNATMAKE 13.2.0 Copyright (C) 1995-2023, Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A=20 PARTICULAR PURPOSE. Checked Godbolt and this happens on trunk there and the ICE appeared to sta= rt with GNAT 12.1 as GNAT 11.4 did not trigger the crash (on Godbolt). Example: procedure Main is generic type Element_Type(<>); package Test_Incomplete_Formal is type Element_Access is access Element_Type; end Test_Incomplete_Formal; type Node; package P is new Test_Incomplete_Formal(Node); type Node is limited null record; begin null; end Main; Output: $ gnatmake.exe main.adb=20 gcc -c main.adb +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3DGNAT BUG DETECTED=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ | 13.2.0 (x86_64-w64-mingw32) Program_Error EXCEPTION_ACCESS_VIOLATION | | Error detected at main.adb:6:7 [main.adb:11:4] | | Compiling main.adb | | Please submit a bug report; see https://gcc.gnu.org/bugs/ . | | Use a subject line meaningful to you and us to track the bug. | | Include the entire contents of this bug box in the report. | | Include the exact command that you entered. | | Also include sources listed below. | +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ Please include these source files with error report Note that list may not be accurate in some cases, so please double check that the problem can still be reproduced with the set of files listed. Consider also -gnatd.n switch (see debug.adb). main.adb compilation abandoned gnatmake: "main.adb" compilation error=