Re: [EXTERNAL] Re: question about knowing when optimization options are used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 16, 2020 at 7:55 PM Shrader, David Lee via Gcc-help
<gcc-help@xxxxxxxxxxx> wrote:
>
> Thank you for the reply. So, what you're saying is that the output of `gcc -Q --help=optimizers` doesn't necessarily reflect what optimization gcc is going to do when -O0 is being used, correct? This is because no (or very little) optimization is actually allowed to be done when -O0 is use.

If you are interested in debugging+optimizations, then you might also
take a look at -Og. It is a relatively new option that is intended to
apply some optimizations while preserving the debugging experience. I
think it showed up around GCC 7, but the first mention in the change
log is GCC 8. Also see
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html .

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

Jeff




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux