[fpc-pascal] Just out of curiosity: Compiling FPC trunk and fpcmake

Karoly Balogh charlie at scenergy.dfmk.hu
Tue Mar 22 11:09:29 CET 2022


Hi,

On Tue, 22 Mar 2022, Victor Campillo via fpc-pascal wrote:

> On 22/3/22 9:51, Mattias Gaertner via fpc-pascal wrote:
> > Is this paranoid or useful?
> > -O- -O1
> >
> Good point. My script have many years and I don't remember why I used this
> options or if I gathered them from someone else, but reviewing it now, it does
> not seems logical. I suppose -O1 overwrite -O-, so specify -O- is completely
> useless.

No, it isn't. -O<number> parameters will _enable_ certain optimizations.
This means, -O3 -O1 will not switch the compiler "back" to -O1, just stay
at -O3, because at -O3 level, all -O1 optimizations are already enabled,
there is nothing to enable.

-O- however will disable all optimizations. So if you want to disable all
previously enabled optimizations, you indeed need to go to the -O- -O1
route. So it is actually useful.

(The above is quite easy to verify, see options.pas, line 2350 and below
in the compiler sources.)

Charlie


More information about the fpc-pascal mailing list