This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/51035] New: GNAT bug detected error reported when compiling Ada code
- From: "aravindvijayan224185 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 08 Nov 2011 17:21:37 +0000
- Subject: [Bug ada/51035] New: GNAT bug detected error reported when compiling Ada code
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51035
Bug #: 51035
Summary: GNAT bug detected error reported when compiling Ada
code
Classification: Unclassified
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: aravindvijayan224185@gmail.com
Created attachment 25754
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25754
The source code
When compiling a test program written in Ada using 4.6.1 20110908 (Red Hat
4.6.1-9) (i686-redhat-linux-gnu) (package gcc-gnat-4.6.1-9.fc15.i686), I see
the following error message:
----------------------------------------------------------------------------
[aravind@localhost ada]$ gnatmake test.adb
gcc -c test.adb
+===========================GNAT BUG DETECTED==============================+
| 4.6.1 20110908 (Red Hat 4.6.1-9) (i686-redhat-linux-gnu) Assert_Failure
sinfo.adb:2547|
| Error detected at test.adb:5: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
test.adb:5:39: extra ")" ignored
compilation abandoned
gnatmake: "test.adb" compilation error
-------------------------------------------------------------------
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;
begin
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.
------------------------------------------------------------------
here is the "gcc -v" output:
[aravind@localhost ada]$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.6.1/lto-wrapper
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin
--enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-ppl --with-cloog --with-tune=generic --with-arch=i686
--build=i686-redhat-linux
Thread model: posix
gcc version 4.6.1 20110908 (Red Hat 4.6.1-9) (GCC)
--------------------------------------------------------------------------
expected behavior:
Just a compiler error due to syntax error
actual behavior:
A bug box even that is only a syntax error
---------------------------------------------------------------------------