[fpc-devel] Question about $OPTIMIZATION LEVELn

Martok listbox at martoks-place.de
Tue Jan 16 18:13:23 CET 2018

> No - see the discussion at https://bugs.freepascal.org/view.php?id=25873

Quick googling shows lots of projects out there that clearly assumed it would.
So we need to get at least the documentation fixed for the future.

If I were to replace {$OPTIMISATIONS ON} with {$OPTIMISATIONS LEVEL4} somewhere,
that switches most optimizations *off* instead of doing more. Not terribly

On the other hand, there is no way to say "do all medium-expensive optimizations
you know on this code": listing them individually is cumbersome, not portable
and not extensible for when new flags are introduced.

Is there even a use case for the current behaviour? I.e., when would one
actually mean -Oolevel3 instead of -O3?


Ceterum censeo b32079 esse sanandam.

More information about the fpc-devel mailing list