------- Comment #1 from bangerth at gmail dot com 2009-01-30 15:13 ------- Yes, I think this would be an optimizing compiler could potentially perform. At the same time I think you are expecting too much from the compiler: it would have to have a semantic understanding of what the strlen function does and that the result can be obtained by merging the two calls to strlen, then merging the two loops, and then truncating them.
I don't think that this sort of analysis is going to be available in compilers anytime soon. Since you already have the solution, maybe this is the way to go! Best W. -- bangerth at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bangerth at gmail dot com Status|UNCONFIRMED |RESOLVED Resolution| |WONTFIX http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38986