https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87505
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |rguenth at gcc dot gnu.org Resolution|--- |INVALID --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- Hmm, we compute the loop iterates ((long unsigned int) base_9(D) - (long unsigned int) (int) base_9(D)) + 3 times. You can probably spot the cases of INT_MAX < base < UINT_MAX not iterating at all (i is sign-extended to std::size_t for the comparison) and base > UINT_MAX where it iterates quite a lot (eventually). We have to account for these cases. If you make the suggested adjustment then of course we know the loop always iterates 4 times. Unless I missed something of course.