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

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

int b;
void a() __attribute__((__noreturn__));
void c() {
  char *buf;
  int bufsz = 64;
  while (b) {
    !bufsz ? a(), 0 : *buf++ = bufsz--;
    b -= 4;
  }
}

The loop has an inverted control flow that accesses memory.
The testcase doesn't seem to have existing cases for these, but due to the
inverted nature the loop's main exit is before the latch exit which we now
consider the early exit.

because we only analyze early exits we miss that there's a memory reference
that needs to be moved, and because it wasn't moved the vUSEs don't line up.

will fix tomorrow when back at work.

Reply via email to