authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-17 00:23:48+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-09-19 12:13:21+02:00
log90c1123d1c9f02c0c2036053dcf9ad6b35e848da
tree4cec33571f6942686abca05fc9c065c06dcee942
parent7d8a9545785b3540ebd8e87d8039fc8239f660ab
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.mem: work around LoongArch inline asm bug in doNotOptimizeAway()

https://github.com/llvm/llvm-project/issues/159200

1 files changed, 2 insertions(+), 1 deletions(-)

lib/std/mem.zig+2-1
......@@ -4485,7 +4485,8 @@ pub fn doNotOptimizeAway(val: anytype) void {
44854485 } else doNotOptimizeAway(&val);
44864486 },
44874487 .float => {
4488 if ((t.float.bits == 32 or t.float.bits == 64) and builtin.zig_backend != .stage2_c) {
4488 // https://github.com/llvm/llvm-project/issues/159200
4489 if ((t.float.bits == 32 or t.float.bits == 64) and builtin.zig_backend != .stage2_c and !builtin.cpu.arch.isLoongArch()) {
44894490 asm volatile (""
44904491 :
44914492 : [_] "rm" (val),