[fpc-devel] Optimization stops near inline asm

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Oct 3 10:24:29 CEST 2011


On 03 Oct 2011, at 10:14, Florian Klämpfl wrote:

> FPC doesn't do any optimization in procedures containing inline  
> assembler.

It does. But also assumes that all registers are used in assembler  
blocks, unless the programmer specifies otherwise. If you change the  
assembler block into

   asm nop end [];

then the statement will optimized. Otherwise the compiler assumes that  
the contents of eax may still be used inside the assembler block and  
hence cannot remove its use.

The fact that the optimization is performed in case the used register  
is ax instead of eax suggests a small bug.


Jonas


More information about the fpc-devel mailing list