From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13830 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Stdio resource usage Date: Wed, 20 Feb 2019 14:24:23 -0500 Message-ID: <20190220192423.GD23599@brightrain.aerifal.cx> References: <20190220104901.GU21289@port70.net> <20190220154740.GD19969@voyager> <7816f8b4-644c-87e3-24c4-4ea2dd404584@adelielinux.org> <20190220191151.GE19969@voyager> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="258833"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13846-gllmg-musl=m.gmane.org@lists.openwall.com Wed Feb 20 20:24:40 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1gwXTy-0015Dx-Qe for gllmg-musl@m.gmane.org; Wed, 20 Feb 2019 20:24:38 +0100 Original-Received: (qmail 28487 invoked by uid 550); 20 Feb 2019 19:24:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 28469 invoked from network); 20 Feb 2019 19:24:36 -0000 Content-Disposition: inline In-Reply-To: <20190220191151.GE19969@voyager> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13830 Archived-At: On Wed, Feb 20, 2019 at 08:11:51PM +0100, Markus Wichmann wrote: > On Wed, Feb 20, 2019 at 12:34:49PM -0600, A. Wilcox wrote: > > On 02/20/19 09:47, Markus Wichmann wrote: > > > It appears as though at least gcc 8 is no longer as inline happy as it > > > once was. > > > > > > I have 0 experience with gcc8, but have you tried explicitly asking? > > These CFLAGS look useful: > > > > -finline-functions > > -finline-functions-called-once > > -finline-small-functions > > > > Best to you and yours, > > --arw > > > > -- > > A. Wilcox (awilfox) > > Project Lead, Adélie Linux > > https://www.adelielinux.org > > > > > For one, that doesn't count, since the whole purpose was to try to > trigger the problem inadvertantly. For two, according to the manpage: > > | -finline-small-functions > | [...] > | Enabled at level -O2. > | > |-finline-functions > | [...] > | Enabled at level -O3. > | > |-finline-functions-called-once > | [...] > | Enabled at levels -O1, -O2, -O3, and -Os. > > I have no idea what the purpose of the enumeration in the last one is, > since the levels are supposed to be cumulative, with -Os being on top of > level 1. Anyway, it appears I inadvertantly *did* try all those > switches. > > Though I did get curious, and decided to check if my method even works. > I'm running objdump on vfprintf.o, and check for the first stack > allocation in the functions. And let the following be my validation: > clang will inline fmt_fp into printf_core at levels -Os and -O3. And > printf_core will allocate 8k of stack. For what it's worth, gcc has a -fconserve-stack that in principle should avoid this problem, but I could never get it to do anything. If it works now we should probably detect and add it to default CFLAGS. Rich