[fpc-devel] about {$OPTIMIZATION xxx} // Re: error in docs ?

Sven Barth pascaldragon at googlemail.com
Thu Feb 6 19:44:51 CET 2014


On 06.02.2014 18:53, Martin Frb wrote:
> On 06/02/2014 17:48, Martin Frb wrote:
>> http://www.freepascal.org/docs-html/prog/progsu58.html#x64-630001.1.58
>>
>>> Example:
>>>
>>> {$OPTIMIZATION ON}
>>>
>>> is equivalent to
>>>
>>> {$OPTIMIZATION 2}
>>
>> "2" is not in the list of supported keywords.
>>
>> And at least {$OPTIMIZATION 1} gives an compile error
>>
>
> {$OPTIMIZATION 2}  gives an error
> but
>
> {$OPTIMIZATION -usemachspeed}
> Note the "-", fpc accepts everithing, if there is a dash, why.

I wonder why as well as the code should check for this....

> Also, it appears one can only enable options, Or go down to a lower
> level? But not selectively switch an opt off?

You need to apply the same logic as for the -Oo option:

{$OPTIMIZATION LOOPUNROLL,NOPEEPHOLE}

{$OPTIMIZATION NOLOOPUNROLL,ASMCSE}

Regards,
Sven



More information about the fpc-devel mailing list