Re: [Mingw-w64-public] [PATCH] crt: Optimize __ms_vsnprintf() for LTO

2022-02-08 Thread LIU Hao
在 2/8/22 17:43, Pali Rohár 写道: Well, I have tried to compile just a simple executable application with "snprintf" call which do not check return value of snprintf function and with LTO built of CRT was _vscprintf call fully eliminated without any undefined reference issues and application

Re: [Mingw-w64-public] [PATCH] crt: Optimize __ms_vsnprintf() for LTO

2022-02-08 Thread Pali Rohár
On Tuesday 08 February 2022 11:22:12 Martin Storsjö wrote: > On Tue, 8 Feb 2022, LIU Hao wrote: > > > 在 2/8/22 16:33, Martin Storsjö 写道: > > > On Sun, 6 Feb 2022, Pali Rohár wrote: > > > > > > > Mark _vscprintf() and _scprintf() functions with attribute pure as their > > > > return value depends

Re: [Mingw-w64-public] [PATCH] crt: Optimize __ms_vsnprintf() for LTO

2022-02-08 Thread Martin Storsjö
On Tue, 8 Feb 2022, LIU Hao wrote: 在 2/8/22 16:33, Martin Storsjö 写道: On Sun, 6 Feb 2022, Pali Rohár wrote: Mark _vscprintf() and _scprintf() functions with attribute pure as their return value depends only on passed arguments. In function __ms_vsnprintf() check only for n==0 and move

Re: [Mingw-w64-public] [PATCH] crt: Optimize __ms_vsnprintf() for LTO

2022-02-08 Thread LIU Hao
在 2/8/22 16:33, Martin Storsjö 写道: On Sun, 6 Feb 2022, Pali Rohár wrote: Mark _vscprintf() and _scprintf() functions with attribute pure as their return value depends only on passed arguments. In function __ms_vsnprintf() check only for n==0 and move _vscprintf() call at the end of function.

Re: [Mingw-w64-public] [PATCH] crt: Optimize __ms_vsnprintf() for LTO

2022-02-08 Thread Martin Storsjö
On Sun, 6 Feb 2022, Pali Rohár wrote: Mark _vscprintf() and _scprintf() functions with attribute pure as their return value depends only on passed arguments. In function __ms_vsnprintf() check only for n==0 and move _vscprintf() call at the end of function. This allows LTO to optimize out

[Mingw-w64-public] [PATCH] crt: Optimize __ms_vsnprintf() for LTO

2022-02-06 Thread Pali Rohár
Mark _vscprintf() and _scprintf() functions with attribute pure as their return value depends only on passed arguments. In function __ms_vsnprintf() check only for n==0 and move _vscprintf() call at the end of function. This allows LTO to optimize out _vscprintf() call from __ms_vsnprintf()