public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/47663] New: Very simple wrapper not inlined
@ 2011-02-09 15:52 rguenth at gcc dot gnu.org
  2011-02-09 16:20 ` [Bug middle-end/47663] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-02-09 15:52 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Very simple wrapper not inlined
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: rguenth@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org
                CC: hubicka@gcc.gnu.org


int foo0();
inline void bar0() { foo0(); }
void foobar() { bar0(); }

is not inlined at -O[12] because

;; Function foobar (foobar)

Analyzing function body size: foobar
  freq:  1000 size:  1 time: 10 bar0 ();
  freq:  1000 size:  1 time:  2 return;
    will eliminated by inlining
Overall function body time: 12-2 size: 4-3
With function call overhead time: 12-12 size: 4-4

;; Function bar0 (bar0)

Analyzing function body size: bar0
  freq:  1000 size:  2 time: 11 foo0 ();
  freq:  1000 size:  1 time:  2 return;
    will eliminated by inlining
Overall function body time: 13-2 size: 5-3
With function call overhead time: 13-12 size: 5-4

and thus

;; Function foobar (foobar)

Considering inline candidate bar0.
Not inlining: code size would grow by 1.


for some reason an unused return value in a call has a cost.

I have a patch.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-04-06 10:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-09 15:52 [Bug middle-end/47663] New: Very simple wrapper not inlined rguenth at gcc dot gnu.org
2011-02-09 16:20 ` [Bug middle-end/47663] " rguenth at gcc dot gnu.org
2011-02-10 13:08 ` rguenth at gcc dot gnu.org
2011-02-22 14:28 ` rguenth at gcc dot gnu.org
2011-04-06  8:51 ` rguenth at gcc dot gnu.org
2011-04-06 10:11 ` rguenth at gcc dot gnu.org

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).