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

* [Bug ada/109798] Gnat Bug Detected
  2023-05-10 15:51 [Bug ada/109798] New: Gnat Bug Detected aj at ianozi dot com
@ 2023-05-11  7:43 ` simon at pushface dot org
  2023-05-11  8:50 ` dkm at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: simon at pushface dot org @ 2023-05-11  7:43 UTC (permalink / raw)
  To: gcc-bugs

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

simon at pushface dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon at pushface dot org

--- Comment #1 from simon at pushface dot org ---
Can’t reproduce (Darwin 22.4.0, GCC 12.1, 12.2, 13.1).

I _do_ get the annoying warning that array aggregates using () is an
obsolescent syntax - see PR104751.

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

* [Bug ada/109798] Gnat Bug Detected
  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
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dkm at gcc dot gnu.org @ 2023-05-11  8:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marc Poulhiès <dkm at gcc dot gnu.org> ---
Can't reproduce on x86_64-linux trunk, 13.1, 12.3, 12.2, 11.3, see
https://ada.godbolt.org/z/Gbv9Wc93E

Can you get the exact compiler invocation?

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

* [Bug ada/109798] Gnat Bug Detected
  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
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2023-05-11 12:19 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-05-11
                 CC|                            |ebotcazou at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Yep, the command line passed to the compiler, please.

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

* [Bug ada/109798] Gnat Bug Detected
  2023-05-10 15:51 [Bug ada/109798] New: Gnat Bug Detected aj at ianozi dot com
                   ` (2 preceding siblings ...)
  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
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: aj at ianozi dot com @ 2023-05-11 12:38 UTC (permalink / raw)
  To: gcc-bugs

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

aj at ianozi dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aj at ianozi dot com

--- Comment #4 from aj at ianozi dot com ---
Created attachment 55050
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55050&action=edit
my alire project with the same code, but failing when I run "alr build"

Oh, huh.  When I build it using gnatmake there's no issues, e.g.
`gnatmake testing.adb`

But when I build it using alire it fails (which is how I was managing my
project).  Let me reach out to the alire team and see if it's happening for
others using Alire.

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

* [Bug ada/109798] Gnat Bug Detected
  2023-05-10 15:51 [Bug ada/109798] New: Gnat Bug Detected aj at ianozi dot com
                   ` (3 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2023-05-11 12:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Oh, huh.  When I build it using gnatmake there's no issues, e.g.
> `gnatmake testing.adb`

Interesting.  Can you pass -v to GPRbuild to display the command line?

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

* [Bug ada/109798] Gnat Bug Detected
  2023-05-10 15:51 [Bug ada/109798] New: Gnat Bug Detected aj at ianozi dot com
                   ` (4 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dkm at gcc dot gnu.org @ 2023-05-11 13:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Marc Poulhiès <dkm at gcc dot gnu.org> ---
`alr -v build -- --keep-temp-files` should provide the expected commands.

You should have all the gcc invocations + be able to see the TMP files used
with `-gnatem` and `-gnatec`.

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

* [Bug ada/109798] Gnat Bug Detected
  2023-05-10 15:51 [Bug ada/109798] New: Gnat Bug Detected aj at ianozi dot com
                   ` (5 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: simon at pushface dot org @ 2023-05-11 14:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from simon at pushface dot org ---
I *can* reproduce with

/opt/gcc-13.1.0-aarch64/bin/gcc -c -x ada -gnatA -Og -ffunction-sections
-fdata-sections -g -gnatwa -gnatw.X -gnatVa -gnaty3 -gnatya -gnatyA -gnatyB
-gnatyb -gnatyc -gnaty-d -gnatye -gnatyf -gnatyh -gnatyi -gnatyI -gnatyk
-gnatyl -gnatym -gnatyn -gnatyO -gnatyp -gnatyr -gnatyS -gnatyt -gnatyu -gnatyx
-gnatW8
-gnatec=/private/var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T/GNAT-TEMP-000003.TMP
-gnatem=/private/var/folders/_q/fvnxz46903z9hjh38fz0lyhm0000gs/T/GNAT-TEMP-000004.TMP
/Users/simon/Developer/bugs/gcc/109798/alire/testing/src/testing.adb

where the -gnatec file contains

pragma Source_File_Name_Project   (Spec_File_Name  => "*.ads",   Casing        
 => lowercase,   Dot_Replacement => "-");
pragma Source_File_Name_Project   (Body_File_Name  => "*.adb",   Casing        
 => lowercase,   Dot_Replacement => "-");

and the -gnatem file contains

testing_config%s
testing_config.ads
/Users/simon/Developer/bugs/gcc/109798/alire/testing/config/testing_config.ads
testing%b
testing.adb
/Users/simon/Developer/bugs/gcc/109798/alire/testing/src/testing.adb


I think it’s the -gnatVa (I took out the -f*sections and all the style options
except a simple -gnaty).

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

* [Bug ada/109798] Gnat Bug Detected
  2023-05-10 15:51 [Bug ada/109798] New: Gnat Bug Detected aj at ianozi dot com
                   ` (6 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: aj at ianozi dot com @ 2023-05-11 14:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from aj at ianozi dot com ---
(In reply to simon from comment #7)
> I think it’s the -gnatVa (I took out the -f*sections and all the style
> options except a simple -gnaty).

simon, you are correct; I independently went through compiling manually taking
out each flag one at a time.  This succeeds:
gcc -c -x ada testing.adb

But this fails:
gcc -c -x ada -gnatVa testing.adb

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

* [Bug ada/109798] Gnat Bug Detected
  2023-05-10 15:51 [Bug ada/109798] New: Gnat Bug Detected aj at ianozi dot com
                   ` (7 preceding siblings ...)
  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
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2023-05-11 15:07 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #9 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> I think it’s the -gnatVa (I took out the -f*sections and all the style
> options except a simple -gnaty).

Indeed, the check generated by -gnatVa for the filter is out of context.

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

* [Bug ada/109798] internal error on iterator filter with -gnatVa
  2023-05-10 15:51 [Bug ada/109798] New: Gnat Bug Detected aj at ianozi dot com
                   ` (8 preceding siblings ...)
  2023-05-11 15:07 ` ebotcazou at gcc dot gnu.org
@ 2023-05-11 15:09 ` ebotcazou at gcc dot gnu.org
  2023-06-15 14:59 ` ebotcazou at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2023-05-11 15:09 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |ebotcazou at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #10 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
I'll have a look.

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

* [Bug ada/109798] internal error on iterator filter with -gnatVa
  2023-05-10 15:51 [Bug ada/109798] New: Gnat Bug Detected aj at ianozi dot com
                   ` (9 preceding siblings ...)
  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
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2023-06-15 14:59 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.2
                URL|                            |https://gcc.gnu.org/piperma
                   |                            |il/gcc-cvs/2023-June/385050
                   |                            |.html
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #11 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Fixed on the mainline and 13 branch.

^ 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).