https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117510
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org Last reconfirmed| |2024-11-11 Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- The issue is that we fail to hoist the m > 0 check out of the outer loop: t.c:4:23: note: Considering guard 7 -> 6 in loop 1 t.c:4:23: missed: Block 5 has side effects <bb 5> [local count: 105119324]: # _10 = PHI <_8(4)> *_3 = _10; I think the logic in find_loop_guard is a bit flawed and it checks too many blocks for side-effects. I'm testing a fix.