On 21.03.2025 18:39, LIU Hao wrote:
在 2025-3-21 23:25, Jacek Caban 写道:
mingw-w64-crt implements a number of functions that the compiler considers built-in. Currently, we must be cautious about compiler optimizations, as they may not align with our intentions. In theory, the compiler could optimize an
implementation of such a function back into a call to itself.

Rather than second-guessing the optimizer and reimplementing problematic
functions in assembly, disable built-in functions globally for mingw-w64-crt.
---
  mingw-w64-crt/Makefile.am | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)


While this change might be safe, we have code that calls `memset()` to clear small structures such as `mbstate_t` (stdio/mingw_pformat.c) or `struct tm` (secapi/_gmtime32_s.c). If we mean to disable all builts, these operations will become real function calls, which is probably not very good.

As part of this change we probably want to turn those references to `__builtin_` ones.


That's a good point, I will look at it.


Thanks,

Jacek



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to