mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: Stdio resource usage
Date: Wed, 20 Feb 2019 14:24:23 -0500	[thread overview]
Message-ID: <20190220192423.GD23599@brightrain.aerifal.cx> (raw)
In-Reply-To: <20190220191151.GE19969@voyager>

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


  reply	other threads:[~2019-02-20 19:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-19 23:34 Nick Bray
2019-02-20  2:43 ` Rich Felker
2019-02-20 10:49   ` Szabolcs Nagy
2019-02-20 15:47     ` Markus Wichmann
2019-02-20 16:37       ` Szabolcs Nagy
2019-02-20 17:13         ` Rich Felker
2019-02-20 18:34       ` A. Wilcox
2019-02-20 19:11         ` Markus Wichmann
2019-02-20 19:24           ` Rich Felker [this message]
2019-02-21 16:09             ` Markus Wichmann
2019-02-21 16:27               ` Jens Gustedt
2019-02-21 17:02               ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190220192423.GD23599@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).