diff --git a/meson.build b/meson.build index 1a207842c55..3d4ea165c99 100644 --- a/meson.build +++ b/meson.build @@ -980,6 +980,11 @@ else '-fno-math-errno', '-fno-trapping-math', '-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 if not (cc.get_id() == 'gcc' and host_machine.system() == 'windows')