This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/30908] -Os inlines functions that are called more than once (optimization regression)
- From: "j at uriah dot heep dot sax dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Feb 2007 12:58:07 -0000
- Subject: [Bug c/30908] -Os inlines functions that are called more than once (optimization regression)
- References: <bug-30908-11199@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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