http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57904
--- Comment #13 from Bernd Edlinger <bernd.edlinger at hotmail dot de> --- (In reply to Jakub Jelinek from comment #12) > But you can always create testcases (in C/C++ etc.) that will hit this > warning, so while the FE change is possible, we need to do something either > about the optimization passes in between IPA and cunrolli (copyprop change > Jeff talks about, perhaps only done for that single pass instance and not > others, or all?, guess depending on how expensive it is) or scheduling there > another instance of some other cleanup pass, or deferring the warning > reporting until some cleanup. > Could someone please provide a C test case that generates this warning? maybe something like: int dovar = from; if (dovar <= to) for (;;) { ... if (dovar == to) break; dovar += step; } > For the FE change, I guess most important are benchmark results, doesn't it > slow down important benchmarks? I think the change in the simple DO-loops really makes sense, independent of this warning. It generates the IL code just a bit more like it is done in C: for (dovar=from; dovar <= to; dovar+=step) { ... } => dovar = from; if (dovar <= to) { loop: ... dovar+=step; if (dovar <= to) goto loop; } Therefore the IL is easier to analyze and chances are good that the optimizer performs better. I can't do these benchmarks however. Who could do that for us?