public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/50503] New: GNAT fails to compile a modification of B433001 ACATS test
@ 2011-09-24  8:36 tero.koskinen at iki dot fi
  2011-10-31 22:37 ` [Bug ada/50503] " simon at pushface dot org
  0 siblings, 1 reply; 2+ messages in thread
From: tero.koskinen at iki dot fi @ 2011-09-24  8:36 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50503
           Summary: GNAT fails to compile a modification of B433001 ACATS
                    test
    Classification: Unclassified
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tero.koskinen@iki.fi


GNAT bug box appears when compiling following procedure:
-- b433001.adb
with text_io; use text_io;
procedure B433001 is

  Rec_1 : constant integer := 5;

  type Test_Array_2 is array (Character range <>, Boolean range <>) of integer;

   O13: Test_Array_2('A'..'B',Boolean) :=
         ((Rec_1, others => <>), (Rec_1, others => <>));    -- bug box

  procedure put(x: test_array_2; c: character; b: boolean) is
  begin
        put_line(Integer'Image (x(c,b)));
        put_line(Integer'Image (x(c,b)));
        new_line;
  end put;

begin
  put(O13,'A',True);
  put(O13,'A',False);
  put(O13,'B',True);
  put(O13,'B',False);
end B433001;

The error:
$ gnatmake b433001
gcc -c b433001.adb
+===========================GNAT BUG DETECTED==============================+
| 4.6.0 20110603 (Red Hat 4.6.0-10) (i686-redhat-linux-gnu) Assert_Failure
nlists.adb:177|
| Error detected at b433001.adb:10:10                                      |
| 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).

b433001.adb

compilation abandoned
gnatmake: "b433001.adb" compilation error
$

The system is Fedora Linux 15/i386.


GNAT GPL 2011 can compile the given file, but constraint error is
(errorneously) raised at runtime:
$ gnatmake b433001.adb
gcc -c b433001.adb
b433001.adb:10:10: warning: too few elements for subtype of "Test_Array_2"
defined at line 9
b433001.adb:10:10: warning: "Constraint_Error" will be raised at run time
gnatbind -x b433001.ali
gnatlink b433001.ali
$ ./b433001

raised CONSTRAINT_ERROR : b433001.adb:10 range check failed
$


When compiled with Janus/Ada, the b433001 procedure above runs without errors
(as expected).


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

* [Bug ada/50503] GNAT fails to compile a modification of B433001 ACATS test
  2011-09-24  8:36 [Bug ada/50503] New: GNAT fails to compile a modification of B433001 ACATS test tero.koskinen at iki dot fi
@ 2011-10-31 22:37 ` simon at pushface dot org
  0 siblings, 0 replies; 2+ messages in thread
From: simon at pushface dot org @ 2011-10-31 22:37 UTC (permalink / raw)
  To: gcc-bugs

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

simon at pushface dot org changed:

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

--- Comment #1 from simon at pushface dot org 2011-10-31 22:37:02 UTC ---
This works correctly (of course, it's vile code, so I had to spend a long time
seeing what it was supposed to do)  with
gcc version 4.7.0 20111026 (experimental) [trunk revision 180524] (GCC) 
Target: x86_64-apple-darwin11


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

end of thread, other threads:[~2011-10-31 22:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-24  8:36 [Bug ada/50503] New: GNAT fails to compile a modification of B433001 ACATS test tero.koskinen at iki dot fi
2011-10-31 22:37 ` [Bug ada/50503] " simon at pushface dot 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).