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: [email protected]
ReportedBy: [email protected]
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.