From patchwork Fri Oct 26 16:53:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix minor bug in accounting external functions Date: Fri, 26 Oct 2012 06:53:15 -0000 From: Jan Hubicka X-Patchwork-Id: 194535 Message-Id: <20121026165315.GB25006@kam.mff.cuni.cz> To: 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++;