public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/109798] New: Gnat Bug Detected
@ 2023-05-10 15:51 aj at ianozi dot com
  2023-05-11  7:43 ` [Bug ada/109798] " simon at pushface dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: aj at ianozi dot com @ 2023-05-10 15:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109798

            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) := ( (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 /= 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 MacOS
and Debian)

The following output occurs and it fails:
```
ⓘ Building testing/testing.gpr...
Compile
   [Ada]          testing.adb
+===========================GNAT BUG DETECTED==============================+
| 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.                                       |
+==========================================================================+

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 syntax,
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 beginning of
the program and just compile it with the gnat2022 switch. 

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-06-15 14:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-10 15:51 [Bug ada/109798] New: Gnat Bug Detected aj at ianozi dot com
2023-05-11  7:43 ` [Bug ada/109798] " simon at pushface dot org
2023-05-11  8:50 ` dkm at gcc dot gnu.org
2023-05-11 12:19 ` ebotcazou at gcc dot gnu.org
2023-05-11 12:38 ` aj at ianozi dot com
2023-05-11 12:54 ` ebotcazou at gcc dot gnu.org
2023-05-11 13:50 ` dkm at gcc dot gnu.org
2023-05-11 14:49 ` simon at pushface dot org
2023-05-11 14:59 ` aj at ianozi dot com
2023-05-11 15:07 ` ebotcazou at gcc dot gnu.org
2023-05-11 15:09 ` [Bug ada/109798] internal error on iterator filter with -gnatVa ebotcazou at gcc dot gnu.org
2023-06-15 14:59 ` ebotcazou at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).