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

--- Comment #10 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
reproducer:

typedef struct {
  unsigned b;
  long bits[2];
} c;
typedef struct {
  c *d;
} e, *bitmap;
e f;
int g;
__attribute__((noipa)) int h(bitmap i) {
  c j = *i->d;
  unsigned k, l = j.b < 4;
  for (; l < 2; l++) {
    long m = j.bits[l];
    for (; k < 64; k++) {
      long n = (long)1 << k;
      if (m & n)
        goto o;
    }
    k = 0;
  }
  return 0;
o:
  return 1;
}
int main() {
  c a;
  a.bits[0] = 1ul << 63;
  f.d = &a;
  g = h(&f);
  return g == 0;
}

--

compiled at -O3. 

This is a LOOP_VINFO_EARLY_BREAKS_VECT_PEELED case where the scalar epilog is
needed for the latch exit, since we stop the vector iteration one (possibly
partial) iteration early.

testing a fix.

Reply via email to