Bug 737319 - GNAT bug detected error reported when compiling Ada code
Summary: GNAT bug detected error reported when compiling Ada code
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 14
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2011-09-11 04:30 UTC by Noel Duffy
Modified: 2011-11-08 17:26 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-11-08 17:26:49 UTC

Attachments (Terms of Use)

Description Noel Duffy 2011-09-11 04:30:58 UTC
When compiling a test program written in Ada using GNAT 4.5.1 20100924 (Red Hat 4.5.1-4) (x86_64-redhat-linux-gnu (package gcc-gnat-4.5.1-4.fc14.x86_64), I see the following error message:

$ gnatmake test.adb
gcc -c test.adb
+===========================GNAT BUG DETECTED==============================+
| 4.5.1 20100924 (Red Hat 4.5.1-4) (x86_64-redhat-linux-gnu) Assert_Failure sinfo.adb:898|
| Error detected at test.adb:4:4                                           |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| 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 gcc or gnatmake command that you entered.              |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |

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


test.adb:4:39: extra ")" ignored
compilation abandoned
gnatmake: "test.adb" compilation error

-- end of output --

The ada program text consists of the following lines:

-- begin program
with Ada.Text_IO;

procedure Test is
   subtype X is Integer range (1 .. 25);
   Y: Integer range X'First .. X'Last := X'First;
   Ada.Text_IO.Put("Hello World");
end Test;

-- end program

The error lies with the line which reads:

   subtype X is Integer range (1 .. 25);

The brackets around the 1 .. 25 are wrong. Once removed, the error goes away.

However, the compiler should report a nice error message and not report that a bug in the compiler has been found.

Comment 1 Aravind vijayan 2011-11-08 17:26:49 UTC
    Thank you for the bug report. At the moment, the Fedora developers don't have time to work on this particular issue. The best way to make sure your problem will get looked on is to report it to the authors of the program. Most upstream authors use a bug tracking system like Bugzilla, and more people who know the code will be looking at the bug report there. 

    I have filed this bug for you at: 

Fedora Bugzappers volunteer triage team

Note You need to log in before you can comment on or make changes to this bug.