[Bug tree-optimization/86071] -O0 -foptimize-sibling-calls doesn't optimize

amonakov at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jun 6 15:58:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86071

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |amonakov at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #1 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
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.


More information about the Gcc-bugs mailing list