[PATCH] clarify documentation of -Q --help=optimizers

Alexander Monakov amonakov@ispras.ru
Tue Nov 3 10:19:00 GMT 2015

On Thu, 22 Oct 2015, Martin Sebor wrote:

> [Sending to the right list this time]
> The documentation of the -Q --help=optimizers options leads some
> to expect that when options are reported as enabled imply the
> corresponding optimization will take place.  (See the following
> question on gcc-help:
> https://gcc.gnu.org/ml/gcc-help/2015-10/msg00133.html)
> The patch below tries to make it clear that that's not always
> the case.


The issue is due to optimization passes being skipped at -O0, and yet
corresponding optimization options not explicitely disabled.  The effect of -O
is an old source of confusion, and now the intro to "Optimization Options"

    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.

(added with this patch:
https://gcc.gnu.org/ml/gcc-patches/2009-10/msg00739.html )

As we observe, it's not visible enough, and I'm not sure saying that again in
the documentation (in a different section) is a good way to go.  Maybe we'd
warn for attempts to enable optimizations at -O0, but that's not trivial.
Perhaps go with Richard's suggestion in the end of this mail ("Thus, at the
end of --help-optimizers print ...")?


More information about the Gcc-patches mailing list