diff options
author | Sam James <sam@gentoo.org> | 2024-12-09 23:11:25 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-12-10 03:02:04 +0000 |
commit | c6cdab1e01bc11bc4036dc5b1be6086f6259c123 (patch) | |
tree | 243f380ea83f2e1de223e9f52cfcea73013c480f /io/fcntl64.c | |
parent | 091dd12831792cef16eee24fe240c73a25b47a1d (diff) | |
download | glibc-release/2.40/master.tar.gz glibc-release/2.40/master.tar.xz glibc-release/2.40/master.zip |
malloc: add indirection for malloc(-like) functions in tests [BZ #32366] release/2.40/master
GCC 15 introduces allocation dead code removal (DCE) for PR117370 in r15-5255-g7828dc070510f8. This breaks various glibc tests which want to assert various properties of the allocator without doing anything obviously useful with the allocated memory. Alexander Monakov rightly pointed out that we can and should do better than passing -fno-malloc-dce to paper over the problem. Not least because GCC 14 already does such DCE where there's no testing of malloc's return value against NULL, and LLVM has such optimisations too. Handle this by providing malloc (and friends) wrappers with a volatile function pointer to obscure that we're calling malloc (et. al) from the compiler. Reviewed-by: Paul Eggert <eggert@cs.ucla.edu> (cherry picked from commit a9944a52c967ce76a5894c30d0274b824df43c7a)
Diffstat (limited to 'io/fcntl64.c')
0 files changed, 0 insertions, 0 deletions