This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -O3 Enabled?
- From: vijay nag <vijunag at gmail dot com>
- To: Hei Chan <structurechart at yahoo dot com>
- Cc: GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Wed, 7 Aug 2013 10:28:43 +0530
- Subject: Re: -O3 Enabled?
- References: <1375841985 dot 93666 dot YahooMailNeo at web165004 dot mail dot bf1 dot yahoo dot com>
On Wed, Aug 7, 2013 at 7:49 AM, Hei Chan <structurechart@yahoo.com> wrote:
> Hi,
>
> I believe my question has been asked before but my search online has no relevant result.
>
> Is it possible to figure whether -O3 is enabled in a static library and an executable? I am using GCC 4.6.x.
>
> Thanks in advance.
>
>
> Cheers,
> Hei
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