LWN.net Logo

What's new in GCC 4.5?

What's new in GCC 4.5?

Posted May 22, 2010 23:18 UTC (Sat) by Cosan (guest, #66500)
Parent article: What's new in GCC 4.5?

LTO is great. When I saw that GCC 4.5 had support for it, I immediately installed it so I could see how well it works, and I was not disappointed.

I've been working on a project that makes use of a lot of small functions. GCC 4.4, at -O3, inlines many of them and this gives a measurable boost in performance. The problem was that one of my source files was getting pretty large, and I wanted to split it up. Of course, splitting it up meant no more inlining (unless I moved a lot of code into headers, and I didn't want to do that).

Once I had 4.5 installed, I went ahead and did the split. Timing it without LTO showed that it was measurably slower, as expected. However, enabling LTO boosted it right back up to the speed it had been running at previously. There was no loss of performance and the code became much more manageable. Three cheers for LTO!

Open64's LTO (aka IPA) is similarly useful, for the record.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds