https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114462
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Apart from marking via -ffinite-loops GCC considers loops without an exit as not required to make "forward progress". That's more than just a constant controlling expression but should allow optimizing most relevant cases.