From patchwork Wed Feb 1 09:19:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 138926 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 48876B6EEC for ; Wed, 1 Feb 2012 20:20:12 +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=1328692813; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Cc:Subject:In-Reply-To:Message-ID:References:User-Agent: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=pkPxjp4iSvrG9aCLKpnXN+ssqGU=; b=WnlablUJGAkQTvY LMddkk3WNp0jj9YHW1C+KQMeDLTbPlZikmsS/UVZ35rQtvvjc1BQTnOqsGR+FLzj RGmvdTb2oOdV3i63QI0S4aeMmazna+M+SAmCHjQCZcZ1rLNNUmFEry9IkL/9sedJ cJXddPOql5uLfcRsbCOnrjv+7Iq8= 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:Cc:Subject:In-Reply-To:Message-ID:References:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=rE+GSLt6aY0BlGLpg5CrYqp8QfyOES2t9YDAkHd/64jAOR254kW84t2yBLhLFc SomWYQAwsv18TVSKhyjIT3Qxc05inJBgDgCB3zDlaGdignehF+3qbE3Htz7AUy0K dN6W1YtVtVU5IadVGrS+iuvlDRS1NSJ9JCrh08QxywpLs=; Received: (qmail 12698 invoked by alias); 1 Feb 2012 09:20:09 -0000 Received: (qmail 12670 invoked by uid 22791); 1 Feb 2012 09:20:07 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Feb 2012 09:19:53 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id BD2668C061; Wed, 1 Feb 2012 10:19:51 +0100 (CET) Date: Wed, 1 Feb 2012 10:19:51 +0100 (CET) From: Richard Guenther To: gcc-patches@gcc.gnu.org Cc: aoliva@redhat.com Subject: Re: [PATCH] Clarify inline flag documentation In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 On Tue, 31 Jan 2012, Richard Guenther wrote: > > Thus, the following tries to clarify the documentation of > -fno-inline and -finline-functions. > > Does that help? lxo noticed a completely off comment in common.opt so I adjusted documentation therein as well. Committed. Richard. 2012-02-01 Richard Guenther * doc/invoke.texi (fno-inline): Clarify documentation. (finline-small-functions): Likewise. (finline-functions): Likewise. * common.opt (finline): Adjust comment and documentation. (finline-small-functions): Clarify documentation. (finline-functions): Likewise. (finline-functions-called-once): Likewise. Index: gcc/doc/invoke.texi =================================================================== *** gcc/doc/invoke.texi (revision 183751) --- gcc/doc/invoke.texi (working copy) *************** Enabled at levels @option{-O2}, @option{ *** 6335,6350 **** @item -fno-inline @opindex fno-inline ! Don't pay attention to the @code{inline} keyword. Normally this option ! is used to keep the compiler from expanding any functions inline. ! Note that if you are not optimizing, no functions can be expanded inline. @item -finline-small-functions @opindex finline-small-functions Integrate functions into their callers when their body is smaller than expected function call code (so overall size of program gets smaller). The compiler heuristically decides which functions are simple enough to be worth integrating ! in this way. Enabled at level @option{-O2}. --- 6335,6354 ---- @item -fno-inline @opindex fno-inline ! Do not expand any functions inline apart from those marked with ! the @code{always_inline} attribute. This is the default when not ! optimizing. ! ! Single functions can be exempted from inlining by marking them ! with the @code{noinline} attribute. @item -finline-small-functions @opindex finline-small-functions Integrate functions into their callers when their body is smaller than expected function call code (so overall size of program gets smaller). The compiler heuristically decides which functions are simple enough to be worth integrating ! in this way. This inlining applies to all functions, even those not declared ! inline. Enabled at level @option{-O2}. *************** Enabled at level @option{-O2}. *** 6359,6367 **** @item -finline-functions @opindex finline-functions ! Integrate all simple functions into their callers. The compiler ! heuristically decides which functions are simple enough to be worth ! integrating in this way. If all calls to a given function are integrated, and the function is declared @code{static}, then the function is normally not output as --- 6363,6371 ---- @item -finline-functions @opindex finline-functions ! Consider all functions for inlining, even if they are not declared inline. ! The compiler heuristically decides which functions are worth integrating ! in this way. If all calls to a given function are integrated, and the function is declared @code{static}, then the function is normally not output as Index: gcc/common.opt =================================================================== --- gcc/common.opt (revision 183791) +++ gcc/common.opt (working copy) @@ -1245,26 +1245,23 @@ findirect-inlining Common Report Var(flag_indirect_inlining) Perform indirect inlining -; Nonzero means that functions declared `inline' will be treated -; as `static'. Prevents generation of zillions of copies of unused -; static inline functions; instead, `inlines' are written out -; only when actually used. Used in conjunction with -g. Also -; does the right thing with #pragma interface. +; General flag to enable inlining. Specifying -fno-inline will disable +; all inlining apart from always-inline functions. finline Common Report Var(flag_no_inline,0) Init(0) -Pay attention to the \"inline\" keyword +Enable inlining of function declared \"inline\", disabling disables all inlining finline-small-functions Common Report Var(flag_inline_small_functions) Optimization -Integrate simple functions into their callers when code size is known to not growth +Integrate functions into their callers when code size is known not to grow finline-functions Common Report Var(flag_inline_functions) Optimization -Integrate simple functions into their callers +Integrate functions not declared \"inline\" into their callers when profitable finline-functions-called-once Common Report Var(flag_inline_functions_called_once) Optimization -Integrate functions called once into their callers +Integrate functions only required by their single caller finline-limit- Common RejectNegative Joined Alias(finline-limit=)