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.