[Bug middle-end/70159] missed CSE optimization
spop at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 10 05:24:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70159
--- Comment #2 from Sebastian Pop <spop at gcc dot gnu.org> ---
Right, with -Ofast it be able to optimize away the branch or selects.
The original benchmark had something more complex than fadd to use the tmin and
tmax results. Here is one more test using the results in a non commutative
operation:
bool foo_p(float d, float min, float max, float a)
{
float tmin;
float tmax;
float inv = 1.0f / d;
if (inv >= 0) {
tmin = (min - a) * inv;
tmax = (max - a) * inv;
} else {
tmin = (max - a) * inv;
tmax = (min - a) * inv;
}
return tmax > tmin;
}
More information about the Gcc-bugs
mailing list