mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-01-22 05:33:55 +08:00
meson: Disable GCC's dead store elimination for memory zeroing custom new
Some classes use custom new operator which zeroes memory, however gcc does aggressive dead-store elimination which threats all writes to the memory before the constructor as "dead stores". For now we disable this optimization. The new operators in question are declared via: DECLARE_RZALLOC_CXX_OPERATORS DECLARE_LINEAR_ZALLOC_CXX_OPERATORS The issue was found with lto builds, however there is no guarantee that it didn't happen with ordinary ones. CC: <mesa-stable@lists.freedesktop.org> Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2977 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1358 Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5104>
This commit is contained in:
parent
a3045cbc97
commit
5500a2b7fc
@ -980,6 +980,11 @@ else
|
|||||||
'-fno-math-errno',
|
'-fno-math-errno',
|
||||||
'-fno-trapping-math',
|
'-fno-trapping-math',
|
||||||
'-Qunused-arguments',
|
'-Qunused-arguments',
|
||||||
|
# Some classes use custom new operator which zeroes memory, however
|
||||||
|
# gcc does aggressive dead-store elimination which threats all writes
|
||||||
|
# to the memory before the constructor as "dead stores".
|
||||||
|
# For now we disable this optimization.
|
||||||
|
'-flifetime-dse=1',
|
||||||
]
|
]
|
||||||
# MinGW chokes on format specifiers and I can't get it all working
|
# MinGW chokes on format specifiers and I can't get it all working
|
||||||
if not (cc.get_id() == 'gcc' and host_machine.system() == 'windows')
|
if not (cc.get_id() == 'gcc' and host_machine.system() == 'windows')
|
||||||
|
Loading…
Reference in New Issue
Block a user