[fpc-devel] Re: dominant short strings in compiler source

Daniël Mantione daniel.mantione at freepascal.org
Thu May 18 20:55:25 CEST 2006



Op Thu, 18 May 2006, schreef Thomas Schatzl:

> Also assembler symbols/labels should get extended to strings > 255 in the
> future because there is already a bug open in which it is demonstrated that it
> is possible to create too long labels which makes a program uncompilable.
> Or some scheme derived which makes sure that labels never get larger than 255
> chars.
> (Typed constant within 2 or 3 nested functions)

This is exactly a thing that will not happen. Longer assembler labels 
have no usefull advantage for the end user, they are only used 
hidden from the user. Long names only cost memory. For mangled names, the compiler
already switches to hashes instead of type lists. If there is any other 
reason a symbol gets to long, it can be handled in a similar way.

> Additionally even the ppc64 compiler isn't able to cycle when compiled with
> -Cg because of the shortstring limitation, a few symbols get truncated, which
> makes the assembler fail.
> This is because the assembler syntax for declaring a symbol in the GOT on this
> platform requires the compiler to add the symbol name twice to the directive.
> This effectively limits symbol names to around 120 chars already. Which is, as
> mentioned before, already not the case for the compiler as it is.

The solution is to generate shorter symbols. Hash the symbol name if it 
gets too long.

Daniël


More information about the fpc-devel mailing list