http://www.freepascal.org/docs-html/prog/progsu58.html#x64-630001.1.58
Show quoted text 7 lines
"2" is not in the list of supported keywords.
And at least {$OPTIMIZATION 1} gives an compile error

Mailing lists / fpc-devel / 2014-02
9 messages · 5 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
http://www.freepascal.org/docs-html/prog/progsu58.html#x64-630001.1.58
"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.Also, it appears one can only enable options, Or go down to a lower level? But not selectively switch an opt off?
Related question: can {$ifopt return any information about optimisation level? (Rationale: the other day I was trying to code some extremely rough fudge factors so that a program could throttle its performance depending on CPU type etc.).
http://www.freepascal.org/docs-html/prog/progsu58.html#x64-630001.1.58 "2" is not in the…
It should be {$OPTIMIZATION LEVEL2} instead (and {$OPTIMIZATION LEVEL1})
Regards,
Sven
{$OPTIMIZATION 2} gives an error but {$OPTIMIZATION -usemachspeed} Note the "-", fpc…
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
{$OPTIMIZATION 2} gives an error but {$OPTIMIZATION -usemachspeed} Note the "-", fpc…
On 06/02/2014 17:48, Martin Frb wrote: [...] {$OPTIMIZATION -usemachspeed} Note the "-", fpc accepts everithing, if there is a dash, why.
- is off.
Everything behind is a comment.
Mattias
Looking at the code parsing the option string I would say no... at least in 2.7.1.
Regards,
Sven
The flag directives like H, I, R, RangeChecks work like this.
Looking at the code parsing the option string I would say no... at least in 2.7.1.
An exception that proves the rule. ;)
Mattias
http://www.freepascal.org/docs-html/prog/progsu58.html#x64-630001.1.58 "2" is not in the…
Fixed.
Michael.