From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: Stdio resource usage
Date: Wed, 20 Feb 2019 16:47:40 +0100 [thread overview]
Message-ID: <20190220154740.GD19969@voyager> (raw)
In-Reply-To: <20190220104901.GU21289@port70.net>
On Wed, Feb 20, 2019 at 11:49:01AM +0100, Szabolcs Nagy wrote:
> * Rich Felker <dalias@libc.org> [2019-02-19 21:43:13 -0500]:
> > This is a known compiler flaw, hoisting large stack allocations, and
> > one I've complained a lot about but with little luck. It might be
> > possible to work around it by making the array a VLA, whose size is 1
> > or the proper size depending on some condition the compiler can't
> > easily see, but that's rather awful. It might be worth doing though,
> > given the lack of progress fixing the bug.
>
> i think it's just an llvm issue, or does this happen with gcc too now?
>
Take me like a data point: On x86_64, with gcc 8.2.0, and -Os, fmt_fp() is
not inlined into printf_core(). And it alone takes a whopping 7496 bytes
of stack (printf_core() only takes 168).
Compiling with -O2 also does not inline fmt_fp(), and it takes 7480
bytes. So somehow -O2 manages to save sixteen bytes of stack.
If I play for all the marbles and use -O3, it still doesn't inline
fmt_fp(), and now it needs 7752 bytes of stack. So now it needs 256
bytes more than originally.
It appears as though at least gcc 8 is no longer as inline happy as it
once was.
>
> aarch64 has 128 bit fp regs, so in principle future arch extension
> may add 128bit instructions without breaking abi. (which may happen
> if aarch64 gets adoption in supercomputers, e.g. powerpc64 did that)
>
Say, if IEEE quad is causing problems, wouldn't it be possible to
compile a tool chain with long double == double for the time being?
Ciao,
Markus
next prev parent reply other threads:[~2019-02-20 15:47 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 [this message]
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
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=20190220154740.GD19969@voyager \
--to=nullplan@gmx.net \
--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).