This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

--- Comment #2 from MichaÅ Walenciak <Kicer86 at gmail dot com> 2011-02-09 19:34:18 UTC ---
(In reply to comment #1)
> It works for me, 

what do you mean by "works" ?:)

> 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.

and this imho is the problem. As -Os suggests, code should be as small as it's
posiible. So i expect that if I use Os, the code will be the smallest that gcc
can produce. However in this example I have to use -O2 or even -O3 to get the
smallest code, and it's misleading.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]