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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
It's also a general -ffast-math missed optimization to demote the double
add to a float one.  If you write

double f(double x[]) {
  float p = 1.0;
  for (int i = 0; i < 16; i++)
    p += (float)x[i];
  return p;
}

the loop is vectorized in a way you expect.

Note such demotion can result in +-Inf where it didn't appear before for
example when x[0] is less than float -Inf "+ 1." and thus (float)x[0] is
not representable but (float)(x[0] + 1.) is.

Still "correct" vectorization should also be possible but is not yet
implemented.

Reply via email to