Marten Jan de Ruiter wrote:
The reason I tried to switch to a newer compiler is that the older compiler crashed on, I suspect, memory usage. Increasing a const that determines the size of a number of arrays causes the crash. Restoring the const to the old value gives a fine compilation. Compiler gpc 20030830, based on gcc-3.2.1 also crashes on a linux machine.
The crashes are consistent in the following way: At a clean start, i.e. after removing all the object and gpi files, the compiler crashes after line 86 in writestruct.p (see below). Subsequent compile runs, with the already compiled .o and .gpi files available, consistently show line 120 of the same file. Could be a --progress-messages thing, not related to the real cause of the crash, but I am not sure.
Progress messages are asynchronous. To see exactly how far it gets, try `--debug-source' or `p lineno' under gdb.
Waldek Hebisch wrote:
It looks that you are passing large arrays by value. Such arrays may cause problems at runtime due to limit on stack usage (by default 10Mb on Linux) -- arguments are passed by value and consume stack space. Unfortunatly, such array consume even more space in the compiler.
But only if they are initialized field by field or something like that, shouldn't they?
Am I missing something? AFAICS, Marten didn't show any actual code. The following program compiles fine for me (but crashes with stack overflow when trying to run it).
program Foo;
type a = array [1 .. 100000000] of Integer;
var v: a;
procedure p (v: a); begin end;
begin p (v) end.
Frank