From patchwork Fri Oct 26 16:53:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 194535 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 72DC92C0093 for ; Sat, 27 Oct 2012 03:53:30 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1351875211; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=FpTDuqLUv22la30FO2ROjw8cuF0=; b=mW/uWPXG6yf16vN F+QBfQgpG+KL9qtrkS38c5Im/0712ohec/axOC/GL3M0A4ReF3m7Bn5RD/MlvS7z Sq7YMHwcxf+/fA4q9VdKR93HMVGPZj6mcK132ggKgLjNqXQJzptpc40AAwfoqAqm eIBUIne5Z2EC2vOgZRstePAGC9ZM= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=YNVGEOmuNaE3HyFV3lgmtfFQwN15cnZoPmpc7ExJYbneXnATZxSlvLO1T7omfA GOSoZacD/hXTDHZDE3O49kuDY5yDv69bXK+VTzb4NrisAYkGPTZnz/vpTs14aC3j dIOlbTvE6a70JGGmuUkMtE9qw309ocg72vFvWqO1dWDyA=; Received: (qmail 17850 invoked by alias); 26 Oct 2012 16:53:24 -0000 Received: (qmail 17837 invoked by uid 22791); 26 Oct 2012 16:53:22 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Oct 2012 16:53:17 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id DD89F5438E2; Fri, 26 Oct 2012 18:53:15 +0200 (CEST) Date: Fri, 26 Oct 2012 18:53:15 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix minor bug in accounting external functions Message-ID: <20121026165315.GB25006@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, inliner knows that removing external function is not going to save any code, but it should also know that inlining into external function that is itself not inline (yet) does not cost you anything either. Bootstrapped/regtested x86_64-linux, comitted. Honza Index: ipa-inline-transform.c =================================================================== --- ipa-inline-transform.c (revision 192821) +++ ipa-inline-transform.c (working copy) @@ -269,7 +269,10 @@ inline_call (struct cgraph_edge *e, bool || predicated); #endif - if (overall_size) + /* Account the change of overall unit size; external functions will be + removed and are thus not accounted. */ + if (overall_size + && !DECL_EXTERNAL (to->symbol.decl)) *overall_size += new_size - old_size; ncalls_inlined++;