public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eljay Love-Jensen <eljay@adobe.com>
To: CSights <csights@fastmail.fm>, GCC-help <gcc-help@gcc.gnu.org>
Subject: Re: binary compiled with -O1 and w/ individual optimization flags are  not the same
Date: Fri, 29 Feb 2008 17:40:00 -0000	[thread overview]
Message-ID: <C3ED9C9B.1FAF%eljay@adobe.com> (raw)
In-Reply-To: <200802291215.47293.csights@fastmail.fm>

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

  parent reply	other threads:[~2008-02-29 17:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-29 17:28 CSights
2008-02-29 17:28 ` Andrew Haley
2008-02-29 17:40 ` Eljay Love-Jensen [this message]
2008-02-29 20:15 ` Brian Dessent
2008-02-29 22:38   ` CSights
     [not found]     ` <47C88B66.A501ABD6@dessent.net>
2008-03-01 15:59       ` CSights
2008-03-01 17:26         ` Tim Prince
2008-03-01 18:22         ` Brian Dessent
2008-03-05 18:13           ` CSights

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C3ED9C9B.1FAF%eljay@adobe.com \
    --to=eljay@adobe.com \
    --cc=csights@fastmail.fm \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).