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;
}

Reply via email to