[fpc-devel] inline and asm code

Marco van de Voort marcov at stack.nl
Wed Aug 3 10:46:49 CEST 2005

> I would suggest an "experimental" solution {$inline unsafe ?} which does the
> inline without checks, and maybe gives a warning at compiletime: Warning:
> inlined func/proc might be unsafe.

The used registers still have to be known. For pascal code this is info that 
is gained during the compilation. For asm this is afaik not kept.
However if sb would work on this and submit a patch (scanning assembler blocks
to build a register use), it would probably help.

> Could save some code and some exection time.
> I do not understand the argument with e.g. EBP usage. I would say this is
> dangerous in not inlined code also, isn't it?

procedure x(a:integer);assembler; stdcall;

  movl 8(%ebp),%eax

Will load parameter in eax. However when inlined it will fail. 

More information about the fpc-devel mailing list