public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/51035] New: GNAT bug detected error reported when compiling Ada code
@ 2011-11-08 17:30 aravindvijayan224185 at gmail dot com
  2012-02-08  6:08 ` [Bug ada/51035] " coopht at gmail dot com
  2012-02-08  7:47 ` charlet at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: aravindvijayan224185 at gmail dot com @ 2011-11-08 17:30 UTC (permalink / raw)
  To: gcc-bugs

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

---------------------------------------------------------------------------


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

* [Bug ada/51035] GNAT bug detected error reported when compiling Ada code
  2011-11-08 17:30 [Bug ada/51035] New: GNAT bug detected error reported when compiling Ada code aravindvijayan224185 at gmail dot com
@ 2012-02-08  6:08 ` coopht at gmail dot com
  2012-02-08  7:47 ` charlet at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: coopht at gmail dot com @ 2012-02-08  6:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51035

Alexander Basov <coopht at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |coopht at gmail dot com

--- Comment #1 from Alexander Basov <coopht at gmail dot com> 2012-02-08 06:08:34 UTC ---
It seems, that this error fixed on trunk.
GNATMAKE 4.7.0 20120202 (experimental)

gcc -c test.adb
test.adb:5:39: extra ")" ignored
gnatmake: "test.adb" compilation error


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

* [Bug ada/51035] GNAT bug detected error reported when compiling Ada code
  2011-11-08 17:30 [Bug ada/51035] New: GNAT bug detected error reported when compiling Ada code aravindvijayan224185 at gmail dot com
  2012-02-08  6:08 ` [Bug ada/51035] " coopht at gmail dot com
@ 2012-02-08  7:47 ` charlet at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: charlet at gcc dot gnu.org @ 2012-02-08  7:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51035

Arnaud Charlet <charlet at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |charlet at gcc dot gnu.org
         Resolution|                            |FIXED
   Target Milestone|---                         |4.7.0

--- Comment #2 from Arnaud Charlet <charlet at gcc dot gnu.org> 2012-02-08 07:46:25 UTC ---
Indeed, closing then.


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

end of thread, other threads:[~2012-02-08  7:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-08 17:30 [Bug ada/51035] New: GNAT bug detected error reported when compiling Ada code aravindvijayan224185 at gmail dot com
2012-02-08  6:08 ` [Bug ada/51035] " coopht at gmail dot com
2012-02-08  7:47 ` charlet 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).