From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13824 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Markus Wichmann Newsgroups: gmane.linux.lib.musl.general Subject: Re: Stdio resource usage Date: Wed, 20 Feb 2019 16:47:40 +0100 Message-ID: <20190220154740.GD19969@voyager> References: <20190220104901.GU21289@port70.net> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="59261"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) To: musl@lists.openwall.com Original-X-From: musl-return-13840-gllmg-musl=m.gmane.org@lists.openwall.com Wed Feb 20 16:48:51 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 1gwU78-000FFQ-1B for gllmg-musl@m.gmane.org; Wed, 20 Feb 2019 16:48:50 +0100 Original-Received: (qmail 5620 invoked by uid 550); 20 Feb 2019 15:48:48 -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 5599 invoked from network); 20 Feb 2019 15:48:47 -0000 Content-Disposition: inline In-Reply-To: <20190220104901.GU21289@port70.net> X-Provags-ID: V03:K1:60rHEvAgHyuZdUXoGK/Uu+vpP9nPrNX5g7ciukYTd8YCWD8vLPr 1AoIlKl/l+vZqlRq/oacrWiSJufIJNZyjubhqv315BHuMT3ToIOzQgJLPLUec4SsBsYVWZl zs6xJDz9WC8l23Mu29hXIoYBxj+4pRvHfiZV+Z6OXEn5I2viaMvaoTVftwaXPLAOy5WTQPb PpxFChby/FosP+XiG+MXQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:iSRIc8tN7hM=:MLRtYq9Utg6yI0tpnJuvic WKMuRRWXi2+0e4bhFsyDt3bJ8kJwLagVHwgnP6azcqEFwTV60t4ywPwnUr8LwQ3X+mGqOgo5h Pljjy/PbSf4b+uvgkVgvmiLzrh39LQ7plwWfUkGrjIfJa5FisaUt5tyPuQy55ecPkqfmrt1XK q6xB7zrMBTxLbbcBX7ct7Z5GXool4t5oOiIwSFgHAlxp9MebmmkDPgHah4pVidy5rv02toYxW EXNNCHemn9qUYKRSYx2vnxi3yddmXTW4r1bsTCQaIb+llcV3ZGWIhrHlN1d8N4132lWd4oUSb J27RjprrnHuHLGMBr+WxT24FSaVQnjmlTnUQEHH87332f5ho2HbX7dBMX1sH5Ru+SIqyoFTIv BFOIBGtI4y+D2zyTH0/alI8qQ7AHa+pRI7Hx+Iy1sLP/7Spa+xW1yKiSSXk9hjq0zhnhsIEFQ ZfuoXCCi9dmwDDDZ41jx906JSD3OCk5vX/FAFi8tviqgLpTxmajX/cctU4dmpnGpjnZroQek5 gKu9ZGrI249OLL+wJjKSuxfLT+elqXtSnHQzo/JTIglRMB64mYbh9qIh5w85fMNI10WLT4wKP 9jnFefEVXiaDdlexQQsbQHhdjaz9dWGaB08dyN5odTl7RE+iOGvWXopJuMdu2aOv3yvEPJCMV EuMgN5d3ETRpEB6ux8XnHYvLBpSvrbd6HFFyUtOy8c9c2doLpXVSvwz3VphapfxRzQZzQ80cg QlJphJ7AT6VH1gVC+TeSBHLEm1Jr4fb2egUXh8LljJI1juxcHSvNeM7Wyl0JAOqA03P1iqm8 Xref: news.gmane.org gmane.linux.lib.musl.general:13824 Archived-At: On Wed, Feb 20, 2019 at 11:49:01AM +0100, Szabolcs Nagy wrote: > * Rich Felker [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