[fpc-devel] Does FPC optimize unused parameters ?

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Aug 24 14:10:45 CEST 2012

Martin wrote on Fri, 24 Aug 2012:

> On 24/08/2012 12:48, Jonas Maebe wrote:
>> That looks like a very serious bug introduced in the handling of  
>> parameters to inlined routines. Florian changed several things  
>> there over the last couple of months, maybe he has an idea.
> If he looks at it, maybe a compiler-switch. It could be treated like  
> in bool eval, that might omit calls.

Definitely not, as far as I am concerned. Either the compiler can  
figure it out by itself, or you add an annotation which the compiler  
then verifies for correctness (like "const" for methods in C++ -- but  
even this I don't like, because it adds a lot of clutter to the source  
code, makes people focus way too much on useless micro-optimizations  
that have to be removed again later because the code changes, and  
leads only to ever more such annotations), but random annotations that  
allow you to completely disable safety checks are mainly a very good  
way to get completely unmaintainable code.


More information about the fpc-devel mailing list