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/30908] -Os inlines functions that are called more than once (optimization regression)



------- Comment #4 from j at uriah dot heep dot sax dot de  2007-02-21 12:58 -------
(In reply to comment #2)

> so it believes code size is unchanged by inlining the function twice
> and removing the now unneeded out-of-line copy.

So does that mean some cost factor needs to be tuned in the AVR target
backend?

(In reply to comment #3)

> And indeed, for x86_64 we have

> so with inlining the function twice text size is smaller than
> without inlining.

Which is not surprising for an i386-alike CPU. :-)

I guess the major saving here is probably because it does not have to
setup stack frames, while on the AVR target, stack frames are already
omitted when not needed, so saving a function call doesn't save that
much there.  Also, the AVR target passes function arguments in
registers.  I guess targets like sparc64 would be better for
comparision.


-- 


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


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