If overflow is defined to wrap around then it's potentially an infinite loop (take N == MAXVALUE). With overflow defined as UB you can say the loop executes exactly N times (because you're not allowed to write code that overflows).
So UB is both bad and a source of power :)
But in the case of C, that is what it is about since unsigned integers have defined behavior, so you can only have UB and the optimizations when you use a signed integer.
Nothing says "buggy port of Linux app to Windows" faster than "#pragma warning (disable: 4018)".
Clang is catching up. GCC doesn't seem to care as much. Given all the bitching about undefined behavior you'd think they'd up the warnings.
Compilers are programs too, y'know. We can define (and gasp, re-define) behavior.
(and you know you're in trouble when you start looking at a new codebase and see a "-fpermissive" in there)
Totally agree with more warnings being needed, I understand that exploiting UB is needed for optimization, but I don't buy the 'well we can't warn about every case, so we won't warn about any' reasoning.