------- Comment #8 from pinskia at gcc dot gnu dot org 2005-11-09 03:09 ------- (In reply to comment #1) > With -funsafe-loop-optimizations we remove them. > Using -Wunsafe-loop-optimizations, we get: > t.c:2: warning: cannot optimize loop, the loop counter may overflow
If the loop counter will overflow for signed types, that is undefined and we should do it no matter what unless -fwrapv is turned on. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23361