http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53265
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2012-05-07 Ever Confirmed|0 |1 --- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-07 14:10:48 UTC --- Confirmed. It's not so simple as cases I have seen do not involve a statically constant nb_interations. Consider enum {N=4}; int a[N], pfx[N]; void foo(int n) { int i, accum; for (i=0, accum=a[0]; i < n; i++, accum+=a[i]) pfx[i] = accum; } and calling that with n == 4. I was suggesting to warn about optimizing a loop exit test to never stop iterating.