https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117045
--- Comment #3 from Richard Sandiford <rsandifo at gcc dot gnu.org> --- Ah, yeah, the patch fixes that too. The easiest fix seemed to be to handle the degenerate cases up-front rather than as part of constant folding. I deliberately left off folding svwhilelt(INT_MAX, x) though, since that seems like a pure optimisation (and so not suitable for backports). I'm hoping to do that as a GCC15-only followup.