This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: binary compiled with -O1 and w/ individual optimization flags are not the same


Hi CSights,

> Is there a way to have g++ tell me which flags it is actually using when
> compiling a program.  E.g. expand -O1 to the individual optimization flags at
> run time?

Yes.

I use this trick:

g++ -O1 -S -fverbose-asm -x c++ <(echo '') -o O1.s

cat O1.s

> Anyone have any other suggestions?

Keep in mind that -O1 or higher turns on many more "behind the scenes"
optimizations than just those that are twiddle-able with the -f optimization
flags.

And keep in mind that -O0 disables all optimizations, irregardless of
specified -f optimization flags (which are ignored).

HTH,
--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]