public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* question about knowing when optimization options are used
@ 2020-03-16 23:14 Shrader, David Lee
  2020-03-16 23:34 ` Segher Boessenkool
  0 siblings, 1 reply; 13+ messages in thread
From: Shrader, David Lee @ 2020-03-16 23:14 UTC (permalink / raw)
  To: gcc-help

Hello,

The gcc man page says:

Most optimizations are only enabled if an -O level is set on the command line.  Otherwise they are disabled, even if individual optimization flags are specified.

The man page says to use `-Q --help=optimizers` to find out what is turned on for the different -O levels as configure-time options can make things different from the defaults shown later in that man page. However, I have found that, even when using -O0, I can turn on optimization options, at least according to the help output:

$> gcc -Q --help=optimizers | grep "\-fmove-loop-invariants"
  -fmove-loop-invariants                [disabled]
$> gcc -Q --help=optimizers -fmove-loop-invariants | grep "\-fmove-loop-invariants"
  -fmove-loop-invariants                [enabled]

I get the same result when using "-O0". Given the line from the gcc man page, I would have expected this option to still be disabled even when using it explicitly on the command line. Have I misunderstood the man page line? Or I am misunderstanding the help output? Or is something else altogether going on?

Thank for any and all help,
David

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-03-19 14:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-16 23:14 question about knowing when optimization options are used Shrader, David Lee
2020-03-16 23:34 ` Segher Boessenkool
2020-03-16 23:55   ` [EXTERNAL] " Shrader, David Lee
2020-03-17  0:36     ` Segher Boessenkool
2020-03-17  1:39       ` Shrader, David Lee
2020-03-17  1:35     ` Jeffrey Walton
2020-03-17  1:44       ` Shrader, David Lee
2020-03-17  2:58         ` Segher Boessenkool
2020-03-17 12:22   ` Richard Sandiford
2020-03-18 20:15     ` Segher Boessenkool
2020-03-18 17:44   ` mark_at_yahoo
2020-03-18 21:24     ` Segher Boessenkool
2020-03-19 14:17   ` Jonathan Wakely

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).