public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/18213] New: New inline heuristic make binary bigger (single call site)
@ 2004-10-28 23:52 jt at hpl dot hp dot com
2004-10-28 23:55 ` [Bug c/18213] " pinskia at gcc dot gnu dot org
2004-10-28 23:58 ` jt at hpl dot hp dot com
0 siblings, 2 replies; 3+ messages in thread
From: jt at hpl dot hp dot com @ 2004-10-28 23:52 UTC (permalink / raw)
To: gcc-bugs
Hi,
I was just upgrading from gcc-2.95 to gcc-3.3.4 (yeah, I'm way behind).
While recompiling my favorite package (Wireless Tools for Linux), I noticed that
gcc was giving me many warning of the type "warning: inlining failed". And the
resulting binary were bigger than with the previous version of gcc.
My package is used in various embedded systems, therefore I compile with -Os
and always watch the size.
Then, I added "__attribute__((always_inline))" to my code, recompiled with
gcc-3.3.4, and the resulting binary was 150B *smaller* than the default
gcc-3.3.4 compile, which is almost a 1% saving (with no loss of functionality).
So, the new inline behaviour is making the binary bigger.
I personally prefer to defer optimisations to compiler, and I would prefer
not to tag functions inline, but I've noticed that gcc is not capable of
automatically inlining functions that have a single call site. And the new
heuristic make it even more difficult to happen properly, I don't really like
the idea of adding "__attribute__((always_inline))" everywhere.
I would actually like gcc to automatically inline static functions with a
single call site, possibly even if they are not marked inline, as keeping track
of all the call sites of all functions is pretty tedious...
Thanks in advance...
Jean
--
Summary: New inline heuristic make binary bigger (single call
site)
Product: gcc
Version: 3.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jt at hpl dot hp dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-linux
GCC host triplet: i386-linux
GCC target triplet: i386-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18213
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/18213] New inline heuristic make binary bigger (single call site)
2004-10-28 23:52 [Bug c/18213] New: New inline heuristic make binary bigger (single call site) jt at hpl dot hp dot com
@ 2004-10-28 23:55 ` pinskia at gcc dot gnu dot org
2004-10-28 23:58 ` jt at hpl dot hp dot com
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-28 23:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-28 23:55 -------
You are still behind, 3.4.0 has an optimization at -O2 and above (-Os included) where we inline
functions which are only called once.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18213
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/18213] New inline heuristic make binary bigger (single call site)
2004-10-28 23:52 [Bug c/18213] New: New inline heuristic make binary bigger (single call site) jt at hpl dot hp dot com
2004-10-28 23:55 ` [Bug c/18213] " pinskia at gcc dot gnu dot org
@ 2004-10-28 23:58 ` jt at hpl dot hp dot com
1 sibling, 0 replies; 3+ messages in thread
From: jt at hpl dot hp dot com @ 2004-10-28 23:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From jt at hpl dot hp dot com 2004-10-28 23:58 -------
Oups, sorry. I'll try to upgrade and verify.
Thanks for the very quick answer...
Jean
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18213
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-10-28 23:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-28 23:52 [Bug c/18213] New: New inline heuristic make binary bigger (single call site) jt at hpl dot hp dot com
2004-10-28 23:55 ` [Bug c/18213] " pinskia at gcc dot gnu dot org
2004-10-28 23:58 ` jt at hpl dot hp dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).