This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]