http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54394
--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> 2012-08-30 15:32:53 UTC --- (In reply to comment #3) > > You can try whether it fixes your regression too. > > Yes, it does. Thanks. Great, thanks. > > Did you check if you get the same run time with -flto and -fwhole-program? If > yes, it would probably mean that -flto is not working as it should on darwin. > How could I check that? With the patch, -fwhole-program is only 1% slower than -flto on my i686 desktop (the x86_64 machine is currently running a bootstrap). -flto can provide a "better-than-fwhole-program" when you use a linker plugin. I do not know what is the status of that on darwin (whether it works at all or what minimum ld version you need, etc.), you'll have to search yourself.