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 #4 from MichaÅ Walenciak <Kicer86 at gmail dot com> 2011-02-09 21:00:46 UTC ---
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > It works for me, 
> > 
> > what do you mean by "works" ?:)
> 
> works as "expected" ;)  At -Os we inline to remove abstraction penalty
> which usually causes code size savings.  More inlining in 90% of all
> cases increases code-size.  As we can't really know at the time of
> inlining whether we will hit the remaining 10% (without doing both
> inlining and not inlining and later throwing away the larger variant)
> we choose the heuristics that usually produce the smallest possible code.

;)
I'm aware of the fact that optimization is a very hard task, but I just wanted
to 
draw devs' attention to this issue.
Maybe gcc should check the real costs of inlining? performing some small tests
or variants of code to choose the better one?


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