This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47658] -Os generates bigger code than -O2/3 for many small inline functions (objects)
- From: "Kicer86 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 9 Feb 2011 19:34:22 +0000
- Subject: [Bug c++/47658] -Os generates bigger code than -O2/3 for many small inline functions (objects)
- Auto-submitted: auto-generated
- References: <bug-47658-4@http.gcc.gnu.org/bugzilla/>
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.