-O3 Enabled?

Ángel González keisial@gmail.com
Wed Aug 7 13:10:00 GMT 2013


On 07/08/13 06:58, vijay nag wrote:
> If you just have the binary without the source, I guess it is
> impossible to figure out optimization level.
>
> If you have source for the same, you can build it with -O0,
> disassemble the code and compare the compiler code emission for a
> particular
> function.
>
> In future, if you would like to know the CFLAGS with which it was
> built, you can export those information to a header as #define's and
> be included
> in one of compilation units.
>
> Vijay Nag
Depending on the compiler/platform/format you could get some hints.
For instance -fomit-frame-pointer would be easy to detect in disassembly.

But it would be a hard and mostly-manual work (and you would probably
need quite a bit of knowledge about gcc phases). I don't think it's worth
trying to figure out.
Do you have a real need for knowing that?




More information about the Gcc-help mailing list