Hi, the following code program Foo; type Bar (U: Cardinal) = array [-1 .. U] of Char; function Baz (F: Bar): Char; begin Baz := F[-1] end; begin end. crashes the compiler: [~/pascal]% gpc -v Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/3.1.1/specs Configured with: ../gcc-3.1.1/configure --enable-languages=pascal Thread model: single gpc version 20021128, based on gcc-3.1.1 [~/pascal]% gpc crash.pas ../../gcc-3.1.1/gcc/p/gpc-typeck.c:1613:build_array_ref: failed assertion `!(TREE_CODE (index) == INTEGER_CST && TYPE_VALUES (TREE_TYPE (array)) && !int_fits_type_p (index, TYPE_VALUES (TREE_TYPE (array))))' crash.pas: In function `Baz': crash.pas:8: Internal compiler error. Please submit a full bug report to the GPC mailing list <gpc@gnu.de>. See <URL:http://www.gnu-pascal.de/todo.html> for details. Exactly the same thing happens also with some other variants of the schema Foo definition: Bar (U: Cardinal) = array [0 .. U] of Char; Bar (L: Integer; U: Cardinal) = array [L .. U] of Char; GPC with 2.95.2 backend crashes hs well, in a slightly different place: [~/pascal]% gpc2 -v Reading specs from /usr/local/bin/../lib/gcc-lib/i586-pc-linux-gnu/2.95.2/specs gpc version 20021111, based on gcc-2.95.2 19991024 (release) [~/pascal]% gpc2 crash.pas /home/emil/dist/gpc-src/gcc-2.95.2/gcc/p/gpc-typeck.c:1860:build_array_ref: failed assertion `0' crash.pas: In function `Baz': crash.pas:8: Internal compiler error. Please submit a full bug report to the GPC mailing list <gpc@gnu.de>. See <URL:http://www.gnu-pascal.de/todo.html> for details. Hope this helps. Emil
On Wed, Dec 11, 2002 at 02:47:31PM +0100, Emil Jerabek wrote: [...]
Exactly the same thing happens also with some other variants of the schema Foo definition:
Sorry, this should be "Bar", not "Foo", of course. I've got confused myself by those stupid names ... Emil
Bar (U: Cardinal) = array [0 .. U] of Char; Bar (L: Integer; U: Cardinal) = array [L .. U] of Char;
Emil Jerabek wrote:
the following code
[...]
crashes the compiler:
[~/pascal]% gpc -v Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/3.1.1/specs Configured with: ../gcc-3.1.1/configure --enable-languages=pascal Thread model: single gpc version 20021128, based on gcc-3.1.1 [~/pascal]% gpc crash.pas ../../gcc-3.1.1/gcc/p/gpc-typeck.c:1613:build_array_ref: failed assertion `!(TREE_CODE (index) == INTEGER_CST && TYPE_VALUES (TREE_TYPE (array)) && !int_fits_type_p (index, TYPE_VALUES (TREE_TYPE (array))))'
Thanks for the report. Will be fixed in the next alpha (emil21*.pas).
GPC with 2.95.2 backend crashes hs well, in a slightly different place:
[~/pascal]% gpc2 -v Reading specs from /usr/local/bin/../lib/gcc-lib/i586-pc-linux-gnu/2.95.2/specs gpc version 20021111, based on gcc-2.95.2 19991024 (release) [~/pascal]% gpc2 crash.pas /home/emil/dist/gpc-src/gcc-2.95.2/gcc/p/gpc-typeck.c:1860:build_array_ref: failed assertion `0'
BTW, it's actually the same place. It has just moved (and changed a little) between the two GPC versions. Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707
participants (2)
-
Emil Jerabek -
Frank Heckenbach