[Bug target/61837] missed loop invariant expression optimization
segher at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Apr 14 07:26:24 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61837
--- Comment #8 from Segher Boessenkool <segher at gcc dot gnu.org> ---
-funswitch-loops changes things like
for (...) {
if (...)
...1;
else
...2;
}
into
if (...) {
for (...)
...1;
} else {
for (...)
...2;
}
which often is not a good idea. This is why this is not done at -O2:
-O2 is only for optimisations that almost never hurt performance.
More information about the Gcc-bugs
mailing list