commit e7f1624e6ea11bb30c779963f9fdfabd51902276 (tree) parent c547a05b656118bef790478c26b439e07c858c76 Author: Alex Rønne Petersen <alex@alexrp.com> Date: Wed, 17 Sep 2025 00:23:48 +0200 std.mem: work around LoongArch inline asm bug in doNotOptimizeAway() https://github.com/llvm/llvm-project/issues/159200 Diffstat:
| M | lib/std/mem.zig | | | 3 | ++- |
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/std/mem.zig b/lib/std/mem.zig @@ -4534,7 +4534,8 @@ pub fn doNotOptimizeAway(val: anytype) void { } else doNotOptimizeAway(&val); }, .float => { - if ((t.float.bits == 32 or t.float.bits == 64) and builtin.zig_backend != .stage2_c) { + // https://github.com/llvm/llvm-project/issues/159200 + if ((t.float.bits == 32 or t.float.bits == 64) and builtin.zig_backend != .stage2_c and !builtin.cpu.arch.isLoongArch()) { asm volatile ("" : : [_] "rm" (val),