http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2012-04-10 CC| |rguenth at gcc dot gnu.org Ever Confirmed|0 |1 --- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-10 12:16:54 UTC --- It's the if (nfds < 0) conditional that we warn on. We cannot currently derive an upper bound for nfds based on the number of iterations of the loop as it is not an induction variable we can analyze. int wait_reading_process_output (void) { int nfds = 0; int channel; for (channel = 0; channel < 1024; ++channel) { if (foo (channel)) nfds++; } if (nfds < 0) return 1; This is in some way a missed optimization in value-range analysis as well.