[Bug tree-optimization/28364] poor optimization choices when iterating over a std::string (probably not c++-specific)

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Jul 13 03:45:00 GMT 2006



------- 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



More information about the Gcc-bugs mailing list