------- Comment #6 from hubicka at gcc dot gnu dot org 2009-06-30 12:44 ------- Created an attachment (id=18100) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18100&action=view) Proposed patch
The problem is that early inliner allows to increase code size estimate by inlining single function by up to 12 instructions. This is higher than on pretty-ipa branch still, since we are not that good on early optimizing yet and some C++ benchmarks (tramp/botan/boost) degrade when reduced to 7 as used by tramp3d. In tramp3d it is mostly caused by dead loops in constructors, and I hope that merging IPA-SRA and CD-DCE improvements will care this on all three benchmarks. At -O2 early inliner needs to be somewhat speculative since it don't know the function profiles yet. It however seems stupid to allow code size growth at -Os in general. This patch changes it reducing compress.o from 14k to 9k on i386. I guess I will need to give it full CSiBE run since it is question whether little speculative inlining won't result in better overall score. Honza -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40436