[fpc-pascal] SIGSEGV with -O2 (was: Illegal type conversion...)

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Nov 23 13:48:48 CET 2009


On 23 Nov 2009, at 13:40, Juha Manninen wrote:

> I understand the compiler is a devel version but if you need a good  
> test case,
> here you have one.


Unfortunately, not really. A good test case is a small self-contained  
test program with no external dependencies that crashes or prints a  
wrong result. A lazarus package does not really fit this description.

> I compiled whole Lazarus with FPC 2.5.1 and  -O2 and it works well.
> VirtualTreeView has non-portable assembly code and may be difficult  
> for the
> compiler.

The compiler does not optimize handwritten assembler code. The most  
likely problem is that this assembler code does not preserve all non- 
volatile registers, and that 2.5.1 uses one of those registers while  
2.2.4 didn't. It could of course also be a compiler bug, but that is  
unlikely (for the simple reason that the main difference between 2.2.4  
and 2.5.1 as far as optimizations are concerned, is that the compiler  
makes slightly better use of registers and that the i386 assembler CSE  
optimizer has been /disabled/ by default).


Jonas



More information about the fpc-pascal mailing list