------- Comment #35 from steven at gcc dot gnu dot org 2010-04-12 10:40 ------- So if I understand correctly, the "state of things" at the moment is this:
Without LTO: > Time: 419.938 sec (6 m 59 s) with LTO incl linker flags: > Time: 443.047 sec (7 m 23 s) In other words, "with LTO" is ~6% slower than without. You say that "results aren't exactly as expected" but I think there is really not much you can expect. First of all, as it is, in GCC 4.5 LTO/WHOPR does not do a whole lot at all. It is really only inlining across translation unit boundaries. Second, LTO doesn't miraculously increase the number of optimization opportunities, and very often it makes things worse on register-starved architectures like i686 (see http://www.cs.rice.edu/~keith/512/Lectures/30IDFAO.pdf for folklore vs. fact in re. interprocedural optimization). Third, for C/C++ programs the source code is usually already organized in such a way to avoid requiring a whole-program view of the program for the compiler to optimize well. Think .h header files, static inline functions, by-value call conventions, etc. And although I don't know clamav very well, I suspect it's completely I/O bound so optimizing away memory latencies etc. (which is really what LTO is mostly about) wouldn't help for clamav anyway. That doesn't mean that optimizing LTO should slow down your program. It would be interesting to see if it's somehow possible to identify the part of the program that got slower. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42776