[Bug ipa/63416] New: Three calls to empty functions via pointers get folded, but not inlined

2014-09-30 Thread felix.shvaiger at emc dot com
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.


[Bug ipa/63416] Three calls to empty functions via pointers get folded, but not inlined

2014-09-30 Thread felix.shvaiger at emc dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63416

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


[Bug ipa/63416] Three calls to empty functions via pointers get folded, but not inlined

2014-09-30 Thread felix.shvaiger at emc dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63416

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


[Bug ipa/63416] Three calls to empty functions via pointers get folded, but not inlined

2014-09-30 Thread felix.shvaiger at emc dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63416

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