From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84544 invoked by alias); 14 Oct 2015 14:36:51 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 84527 invoked by uid 89); 14 Oct 2015 14:36:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f46.google.com Received: from mail-qg0-f46.google.com (HELO mail-qg0-f46.google.com) (209.85.192.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 14 Oct 2015 14:36:48 +0000 Received: by qgez77 with SMTP id z77so44414429qge.1 for ; Wed, 14 Oct 2015 07:36:46 -0700 (PDT) X-Received: by 10.140.41.81 with SMTP id y75mr4484198qgy.5.1444833406441; Wed, 14 Oct 2015 07:36:46 -0700 (PDT) Received: from [192.168.0.26] (97-124-165-221.hlrn.qwest.net. [97.124.165.221]) by smtp.gmail.com with ESMTPSA id b104sm3470861qga.7.2015.10.14.07.36.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 07:36:45 -0700 (PDT) Message-ID: <561E687B.8000705@gmail.com> Date: Wed, 14 Oct 2015 14:36:00 -0000 From: Martin Sebor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Arkadiusz Drabczyk , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] c/67925 - update documentation on `inline' References: <20151013224721.GA540@comp.lan> In-Reply-To: <20151013224721.GA540@comp.lan> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg01366.txt.bz2 On 10/13/2015 04:47 PM, Arkadiusz Drabczyk wrote: > * gcc/doc/extend.texi: documentation says that functions declared > `inline' would not be integrated if they are called before they are > defined or if they are recursive. Both of these statements is now > false as shown in examples on Bugzilla. It might also be worth updating the note in the subsequent paragraph and removing the mention of variable-length data types which no longer prevent inlining. FWIW, the list of most -Winline warnings issued by GCC is here (there are two more in Ada which, AFAICT, have to do with nested functions): $ grep -A1 "can never be inlined" gcc/tree-inline.c = G_("function %q+F can never be inlined because it uses " "alloca (override using the always_inline attribute)"); -- = G_("function %q+F can never be inlined because it uses setjmp"); *handled_ops_p = true; -- = G_("function %q+F can never be inlined because it " "uses variable argument lists"); -- = G_("function %q+F can never be inlined because " "it uses setjmp-longjmp exception handling"); -- = G_("function %q+F can never be inlined because " "it uses non-local goto"); -- = G_("function %q+F can never be inlined because " "it uses __builtin_return or __builtin_apply_args"); -- = G_("function %q+F can never be inlined " "because it contains a computed goto"); -- warning (OPT_Winline, "function %q+F can never be inlined because it " "is suppressed using -fno-inline", fn); -- warning (OPT_Winline, "function %q+F can never be inlined because it " "uses attributes conflicting with inlining", fn); Martin > --- > gcc/doc/extend.texi | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi > index 79440d3..7ea4b62 100644 > --- a/gcc/doc/extend.texi > +++ b/gcc/doc/extend.texi > @@ -7088,12 +7088,9 @@ function are integrated into the caller, and the function's address is > never used, then the function's own assembler code is never referenced. > In this case, GCC does not actually output assembler code for the > function, unless you specify the option @option{-fkeep-inline-functions}. > -Some calls cannot be integrated for various reasons (in particular, > -calls that precede the function's definition cannot be integrated, and > -neither can recursive calls within the definition). If there is a > -nonintegrated call, then the function is compiled to assembler code as > -usual. The function must also be compiled as usual if the program > -refers to its address, because that can't be inlined. > +If there is a nonintegrated call, then the function is compiled to > +assembler code as usual. The function must also be compiled as usual if > +the program refers to its address, because that can't be inlined. > > @opindex Winline > Note that certain usages in a function definition can make it unsuitable >