This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/50263] New: Constant integer in multidimensional array 'Range(X) crashes GNAT
- From: "gnubugs at lyse dot isobeef.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Sep 2011 12:36:23 +0000
- Subject: [Bug ada/50263] New: Constant integer in multidimensional array 'Range(X) crashes GNAT
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50263
Bug #: 50263
Summary: Constant integer in multidimensional array 'Range(X)
crashes GNAT
Classification: Unclassified
Product: gcc
Version: 4.4.6
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: gnubugs@lyse.isobeef.org
Created attachment 25160
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25160
Sample Ada source code to show the crash
When using a constant integer in a 'Range(X) value of an multidimensional
array, gnatmake crashes with a bug box. However, using a constant works. Having
the following definitions
type Matrix_Type is array (1..3, 1..3) of Integer;
First_Range : constant Integer := 1;
Matrix : Matrix_Type := (others => (others => 0));
GNAT will crash when compiling
Matrix'Range(First_Range)
When First_Range is replaced by
First_Range : constant := 1;
everything is fine. See attached source code to reproduce this. I'm using
GNATMAKE 4.4.6 from Debian Testing.
$ gnatmake constant_integer_as_array_range_value_crashes_gnat.adb
gcc-4.4 -c constant_integer_as_array_range_value_crashes_gnat.adb
+===========================GNAT BUG DETECTED==============================+
| 4.4.6 (i486-pc-linux-gnu) Assert_Failure sinfo.adb:1563 |
| Error detected at
constant_integer_as_array_range_value_crashes_gnat.adb:15:19|
| 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-4.4 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.
constant_integer_as_array_range_value_crashes_gnat.adb
compilation abandoned
gnatmake: "constant_integer_as_array_range_value_crashes_gnat.adb" compilation
error
Exit code 4.