public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/63416] New: Three calls to empty functions via pointers get folded, but not inlined
@ 2014-09-30 15:33 felix.shvaiger at emc dot com
  2014-09-30 15:36 ` [Bug ipa/63416] " felix.shvaiger at emc dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: felix.shvaiger at emc dot com @ 2014-09-30 15:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63416

            Bug ID: 63416
           Summary: Three calls to empty functions via pointers get
                    folded, but not inlined
           Product: gcc
           Version: 4.7.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: felix.shvaiger at emc dot com

Created attachment 33620
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33620&action=edit
3 function calls -> folded, not inlined

Missed inlining opportunity.

Issue exists in x86 arch.
4.7, 4.8, 4.9, 5.0 versions (maybe earlier too).
Option: -O2, -O3

If 2 near-empty functions called via pointers, then calls get folded and
inlined.
If 3rd empty function call via pointer added, then all calls get folded, but
not inlined.

Attached test cases (self-contained, no includes):
a1.c -- 3 function calls -> folded, not inlined.


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

* [Bug ipa/63416] Three calls to empty functions via pointers get folded, but not inlined
  2014-09-30 15:33 [Bug ipa/63416] New: Three calls to empty functions via pointers get folded, but not inlined felix.shvaiger at emc dot com
@ 2014-09-30 15:36 ` felix.shvaiger at emc dot com
  2014-09-30 15:39 ` felix.shvaiger at emc dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: felix.shvaiger at emc dot com @ 2014-09-30 15:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63416

--- Comment #1 from Felix Shvaiger <felix.shvaiger at emc dot com> ---
Created attachment 33621
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33621&action=edit
2 function calls -> (for comparison) folded, inlined


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

* [Bug ipa/63416] Three calls to empty functions via pointers get folded, but not inlined
  2014-09-30 15:33 [Bug ipa/63416] New: Three calls to empty functions via pointers get folded, but not inlined felix.shvaiger at emc dot com
  2014-09-30 15:36 ` [Bug ipa/63416] " felix.shvaiger at emc dot com
@ 2014-09-30 15:39 ` felix.shvaiger at emc dot com
  2014-09-30 15:40 ` felix.shvaiger at emc dot com
  2014-10-01 14:39 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: felix.shvaiger at emc dot com @ 2014-09-30 15:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63416

--- Comment #2 from Felix Shvaiger <felix.shvaiger at emc dot com> ---
Created attachment 33622
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33622&action=edit
disassembly of compiled a1.c -- bad code


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

* [Bug ipa/63416] Three calls to empty functions via pointers get folded, but not inlined
  2014-09-30 15:33 [Bug ipa/63416] New: Three calls to empty functions via pointers get folded, but not inlined felix.shvaiger at emc dot com
  2014-09-30 15:36 ` [Bug ipa/63416] " felix.shvaiger at emc dot com
  2014-09-30 15:39 ` felix.shvaiger at emc dot com
@ 2014-09-30 15:40 ` felix.shvaiger at emc dot com
  2014-10-01 14:39 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: felix.shvaiger at emc dot com @ 2014-09-30 15:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63416

--- Comment #3 from Felix Shvaiger <felix.shvaiger at emc dot com> ---
Created attachment 33623
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33623&action=edit
disassembly of compiled a2.c -- good code


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

* [Bug ipa/63416] Three calls to empty functions via pointers get folded, but not inlined
  2014-09-30 15:33 [Bug ipa/63416] New: Three calls to empty functions via pointers get folded, but not inlined felix.shvaiger at emc dot com
                   ` (2 preceding siblings ...)
  2014-09-30 15:40 ` felix.shvaiger at emc dot com
@ 2014-10-01 14:39 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-10-01 14:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63416

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Must be sth wrong with size/time estimates.  Honza?


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

end of thread, other threads:[~2014-10-01 14:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-30 15:33 [Bug ipa/63416] New: Three calls to empty functions via pointers get folded, but not inlined felix.shvaiger at emc dot com
2014-09-30 15:36 ` [Bug ipa/63416] " felix.shvaiger at emc dot com
2014-09-30 15:39 ` felix.shvaiger at emc dot com
2014-09-30 15:40 ` felix.shvaiger at emc dot com
2014-10-01 14:39 ` 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).