authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-09-13 18:19:36-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-09-13 18:20:18-07:00
log68f2d6cb245599e922c5758c8de9036286371f2c
tree9c9558c36c5475cbeec041b2f70912f6338f441b
parent0a89624d599cfcb884946dfb938945f399df085a

std: remove workaround for fixed bug

The miscompilation in question has been fixed upstream in LLVM 13. closes #8117

1 files changed, 3 insertions(+), 15 deletions(-)

lib/std/multi_array_list.zig+3-15
......@@ -320,11 +320,7 @@ pub fn MultiArrayList(comptime S: type) type {
320320 inline for (fields) |field_info, i| {
321321 if (@sizeOf(field_info.field_type) != 0) {
322322 const field = @intToEnum(Field, i);
323 // TODO we should be able to use std.mem.copy here but it causes a
324 // test failure on aarch64 with -OReleaseFast
325 const src_slice = mem.sliceAsBytes(self_slice.items(field));
326 const dst_slice = mem.sliceAsBytes(other_slice.items(field));
327 @memcpy(dst_slice.ptr, src_slice.ptr, src_slice.len);
323 mem.copy(field_info.field_type, other_slice.items(field), self_slice.items(field));
328324 }
329325 }
330326 gpa.free(self.allocatedBytes());
......@@ -388,11 +384,7 @@ pub fn MultiArrayList(comptime S: type) type {
388384 inline for (fields) |field_info, i| {
389385 if (@sizeOf(field_info.field_type) != 0) {
390386 const field = @intToEnum(Field, i);
391 // TODO we should be able to use std.mem.copy here but it causes a
392 // test failure on aarch64 with -OReleaseFast
393 const src_slice = mem.sliceAsBytes(self_slice.items(field));
394 const dst_slice = mem.sliceAsBytes(other_slice.items(field));
395 @memcpy(dst_slice.ptr, src_slice.ptr, src_slice.len);
387 mem.copy(field_info.field_type, other_slice.items(field), self_slice.items(field));
396388 }
397389 }
398390 gpa.free(self.allocatedBytes());
......@@ -411,11 +403,7 @@ pub fn MultiArrayList(comptime S: type) type {
411403 inline for (fields) |field_info, i| {
412404 if (@sizeOf(field_info.field_type) != 0) {
413405 const field = @intToEnum(Field, i);
414 // TODO we should be able to use std.mem.copy here but it causes a
415 // test failure on aarch64 with -OReleaseFast
416 const src_slice = mem.sliceAsBytes(self_slice.items(field));
417 const dst_slice = mem.sliceAsBytes(result_slice.items(field));
418 @memcpy(dst_slice.ptr, src_slice.ptr, src_slice.len);
406 mem.copy(field_info.field_type, result_slice.items(field), self_slice.items(field));
419407 }
420408 }
421409 return result;