https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48052
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> --- That's an interesting idea - your argument is that if niter analysis was able to compute an expression for the number of iterations and the cast we are looking at is a widening of a BIV then it is ok to assume the BIV does not wrap. Unfortunately this breaks down (eventually not in practice due to your exclusion of constant initial BIV value) for cases like for (unsigned i = 3; i != 2; i+=7) ; where niter analysis can still compute the number of iterations (I've made the numbers up, so maybe that loop will never terminate...). Still the idea is interesting as we might be able to record whether BIVs overflow or not.