[Bug c++/47658] -Os generates bigger code than -O2/3 for many small inline functions (objects)

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 9 11:07:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47658

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-02-09 10:58:01 UTC ---
It works for me, the abstraction is completely eliminated by early inlining.
At -Os we do not inline E::foo2 into E::foo1 but that isn't abstraction and
it isn't easily visible that this is profitable.  That results in the
-Os code being around 10% larger than -O2 code.  You can check the
dump generated by -fdump-tree-einline-details for reasoning and size estimates
used.



More information about the Gcc-bugs mailing list