[fpc-devel] Compiler limitations
Florian Klaempfl
florian at freepascal.org
Fri May 9 23:16:18 CEST 2008
Daniƫl Mantione schrieb:
>
>
> Op Fri, 9 May 2008, schreef Florian Klaempfl:
>
>> Vincent Snijders schrieb:
>>> Florian Klaempfl schreef:
>>>> Miklos Cserzo schrieb:
>>>>>
>>>>> Hi Folks,
>>>>>
>>>>> according the documentation "Arrays are limited to 2 GBytes in size
>>>>> in the default processor mode." Is there another mode allowing
>>>>> bigger arrays?
>>>>
>>>> 64 Bit mode/compiler.
>>>>
>>>
>>> Except for darwin.
>>>
>>> Except it doesn't work:
>>> http://www.freepascal.org/testsuite/cgi-bin/testsuite.cgi?action=3&run1id=21737&testfileid=2417
>>
>>
>> This is operation system dependent also if you can declare static data
>> structures of this size. Things like
>>
>> type
>> ta = array[0..$fffffffff] of byte;
>> var
>> p : ^ta;
>>
>> begin
>> new(p);
>> end.
>>
>> should work e.g. on linux.
>
> Yes, this would work, but wrapping it in a record and adding a field to
> it might not work. The reason is that the x86_64 still uses singed
> 32-bit displacements in its operands.
This is only important for static data which requires relocation. For
heap/stack the compiler simply generates the constants.
> To support this, a different code
> generation is needed, which we don't have.
>
> Many compilers have an mcmodel switch. FPC's x86_64 code generation
> compares to mcmodel=small.
More information about the fpc-devel
mailing list