From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EBF623853814; Wed, 10 May 2023 15:51:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EBF623853814 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683733917; bh=fpWKXFxsqjvbFxTQkG1/ZferABq/MWImRmqX79uDhvI=; h=From:To:Subject:Date:From; b=mizVCfqIjevSQdhPDd8cxfKuRPBnMvNQReOEFKNFFNcbOAKEB63eSxeON4bl5VtIw D1uk+g/09e8muFLEf8tAtul0Fy7wvw2WNhMurZCmeICrcHf+hGvJYyXFgk7X9fails iGI0f4Y7a8LxWDIM2adQVsiSj3DK2XF6/6ZCgmQQ= From: "aj at ianozi dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/109798] New: Gnat Bug Detected Date: Wed, 10 May 2023 15:51:56 +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: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aj at ianozi 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 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=3D109798 Bug ID: 109798 Summary: Gnat Bug Detected Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ada Assignee: unassigned at gcc dot gnu.org Reporter: aj at ianozi dot com CC: dkm at gcc dot gnu.org Target Milestone: --- Steps to reproduce: 1) Create test program called "testing.adb" with the following contents: ``` pragma Ada_2022; procedure Testing is type Test_Enum is (apple, orange, banana); type Test_Type is record The_Type : Test_Enum; The_Value : Integer; end record; type Test_Array is array (Positive range <>) of Test_Type; My_Array : Test_Array (1 .. 6) :=3D ( (apple, 5), (orange, 10), (banana,= 1), (orange, 15), (orange, 12), (apple, 5) ); begin for I in My_Array'Range when My_Array (I).The_Type /=3D orange loop null; end loop; end Testing; ``` 2) Compile with gcc 12.0 or greater (I tested it with both gcc 12.2.0 or Ma= cOS and Debian) The following output occurs and it fails: ``` =E2=93=98 Building testing/testing.gpr... Compile [Ada] testing.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+ | 12.1.0 (x86_64-apple-darwin19.6.0) GCC error: | | in gnat_to_gnu_entity, at ada/gcc-interface/decl.cc:472 | | Error detected at testing.adb:13:21 | | Compiling /Users/ianozi/projects/testing/testing/src/testing.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). /Users/ianozi/projects/testing/testing/src/testing.adb testing.adb:10:04: warning: "My_Array" is not modified, could be declared constant [-gnatwk] testing.adb:10:38: warning: array aggregate using () is an obsolescent synt= ax, use [] instead [-gnatwj] testing.adb:10:39: (style) space not allowed compilation abandoned compilation of testing.adb failed gprbuild: *** compilation phase failed error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/Users/ianozi/projects/testing/testing/testing.gpr"] exited with code 4 error: Compilation failed. ``` I get the same thing on debian, except the gnat bug detected says ``` | 12.2.0 (x86_64-pc-linux-gnu) GCC error: | | in gnat_to_gnu_entity, at ada/gcc-interface/decl.cc:472 | ``` Instead of the apple-darwin stuff. The same thing happens if I remove the "pragma Ada_2022;" from the beginnin= g of the program and just compile it with the gnat2022 switch.=20 Is this happening for anyone else? I apologize if I'm filing this bug wrong, or if it's a duplicate, it's the first time I'm doing this. Kind regards, AJ.=