From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17005 invoked by alias); 30 Sep 2014 15:33:22 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 16681 invoked by uid 48); 30 Sep 2014 15:33:17 -0000 From: "felix.shvaiger at emc dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/63416] New: Three calls to empty functions via pointers get folded, but not inlined Date: Tue, 30 Sep 2014 15:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 4.7.4 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: felix.shvaiger at emc dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-09/txt/msg02774.txt.bz2 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.