------- Comment #24 from dimhen at gmail dot com 2010-07-18 12:56 ------- is this the same problem? -- 'i*2 < 35' can't overflow
void foo(char *ptr, unsigned size) { unsigned i; for(i=0; i*2 < size && i*2 < 35; i++ ) { *ptr++ = 0; } } # gcc -Wunsafe-loop-optimizations -O3 -c unsafe_loop.c unsafe_loop.c: In function foo: unsafe_loop.c:5:5: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations] gcc/x86/[trunk revision 162274] -- dimhen at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dimhen at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26939