From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23930 invoked by alias); 7 Dec 2018 23:28:07 -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 23916 invoked by uid 89); 7 Dec 2018 23:28:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Hx-languages-length:1936, gty, GTY, letter X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Dec 2018 23:28:05 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id wB7NRqDf014259; Fri, 7 Dec 2018 17:27:54 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id wB7NRneL014258; Fri, 7 Dec 2018 17:27:49 -0600 Date: Fri, 07 Dec 2018 23:28:00 -0000 From: Segher Boessenkool To: Torbjorn SVENSSON Cc: "gcc-patches@gcc.gnu.org" , "Joey.Ye@arm.com" , Niklas DAHLQUIST , Samuel HULTGREN , Christophe LYON , Christophe MONAT Subject: Re: [PATCH] Added information about inline assembler in stack calculations (.su files) Message-ID: <20181207232748.GE3803@gate.crashing.org> References: <7f229423-5edb-88e8-a5c2-7c9660339255@st.com> <20181127184030.GZ23873@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00505.txt.bz2 Hi Torbjorn, Just some formatting nitpicking: On Tue, Nov 27, 2018 at 07:45:59PM +0000, Torbjorn SVENSSON wrote: > diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > index 38e27a50a1e..e61ddc3260b 100644 > --- a/gcc/doc/invoke.texi > +++ b/gcc/doc/invoke.texi > @@ -6456,7 +6456,7 @@ Warn if the stack usage of a function might exceed @var{byte-size}. > The computation done to determine the stack usage is conservative. > Any space allocated via @code{alloca}, variable-length arrays, or related > constructs is included by the compiler when determining whether or not to > -issue a warning. > +issue a warning. @code{asm} statements are ignored when computing stack usage. Two spaces after a full stop. Please try to start sentences with a capital letter. > --- a/gcc/function.c > +++ b/gcc/function.c > @@ -1822,6 +1822,10 @@ instantiate_virtual_regs_in_insn (rtx_insn *insn) > > if (asm_noperands (PATTERN (insn)) >= 0) > { > + if (flag_stack_usage_info) > + { > + current_function_has_inline_assembler = 1; > + } Single statements should not normally get a { block } wrapped around it. > diff --git a/gcc/function.h b/gcc/function.h > index 7e59050e8a6..8c3ef49e866 100644 > --- a/gcc/function.h > +++ b/gcc/function.h > @@ -208,11 +208,16 @@ struct GTY(()) stack_usage > /* Nonzero if the amount of stack space allocated dynamically cannot > be bounded at compile-time. */ > unsigned int has_unbounded_dynamic_stack_size : 1; > + > + /* NonZero if body contains asm statement (ignored in stack calculations) */ > + unsigned int has_inline_assembler: 1; "Nonzero", no camelcase. I think it should be "an asm statement", or "some asm statemement", or similar. The line should end with a full stop and two spaces, before the */. > + /* Add info regarding inline assembler (not part of stack calculations) */ Similar here. Segher