https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86071
--- Comment #2 from Konstantin Kharlamov <Hi-Angel at yandex dot ru> --- (In reply to Alexander Monakov from comment #1) > In GCC there's no way to selectively enable a few optimizations with their > -f flags at -O0 level: -O0 means that optimizations are completely disabled, > regardless of -f flags. This is mentioned in the manual: > > "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." > > > Tail call optimization sometimes is not applied because there's an escaping > local variable (possibly from an inlined function), and GCC does not take > into account its life range. This might be what you're seeing at -O3. > There's a recent report: PR 86050. That said, your quote from docs does not say that optimizations are completely disabled regardless of -f. It only says that most optimizations are disabled. And indeed: why to have options, if they doesn't work? So I think it still qualifies as a bug, even if a low-priority one.