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