------- Comment #15 from pinskia at gcc dot gnu dot org 2006-07-13 03:45 ------- One more comment, a loop with an early exit is whole issue and that is the reason why all of the code in the loop is considered the header. There are a couple of loop headers in this case, one for each exit which makes it harder to deal with in general.
What you did not mention is which how would this loop exit normally, via the return 1 or all the way through the loop. There is no enough information from GCC's point of view to figure that out without profiling (for this case). GCC is assuming that the loop exits in the first if statement which seems reasoniable. Maybe you should try with profiling information and see what GCC does for this testcase. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364