Segher Boessenkool <segher@xxxxxxxxxxxxxxxxxxx> writes: > On Mon, Mar 16, 2020 at 11:14:25PM +0000, Shrader, David Lee via Gcc-help wrote: >> 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. > > Yes. > >> 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: > > You can enable the *flags*, sure, but with -O0 those flags do not do > anything. Exactly as the text above says? The "even if" part. I think David's the right that the wording isn't clear though. The documentation sets up a contrast between an option being "enabled" or merely "specified", with "enabled" meaning something like "have an effect". But the quoted output then undermines that by using "enabled" for what the documentation calls "specified": $> gcc -Q --help=optimizers -fmove-loop-invariants | grep "\-fmove-loop-invariants" -fmove-loop-invariants [enabled] I can definitely see why this is confusing. Richard