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 {...@@ -320,11 +320,7 @@ pub fn MultiArrayList(comptime S: type) type {
320 inline for (fields) |field_info, i| {320 inline for (fields) |field_info, i| {
321 if (@sizeOf(field_info.field_type) != 0) {321 if (@sizeOf(field_info.field_type) != 0) {
322 const field = @intToEnum(Field, i);322 const field = @intToEnum(Field, i);
323 // TODO we should be able to use std.mem.copy here but it causes a323 mem.copy(field_info.field_type, other_slice.items(field), self_slice.items(field));
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);
328 }324 }
329 }325 }
330 gpa.free(self.allocatedBytes());326 gpa.free(self.allocatedBytes());
...@@ -388,11 +384,7 @@ pub fn MultiArrayList(comptime S: type) type {...@@ -388,11 +384,7 @@ pub fn MultiArrayList(comptime S: type) type {
388 inline for (fields) |field_info, i| {384 inline for (fields) |field_info, i| {
389 if (@sizeOf(field_info.field_type) != 0) {385 if (@sizeOf(field_info.field_type) != 0) {
390 const field = @intToEnum(Field, i);386 const field = @intToEnum(Field, i);
391 // TODO we should be able to use std.mem.copy here but it causes a387 mem.copy(field_info.field_type, other_slice.items(field), self_slice.items(field));
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);
396 }388 }
397 }389 }
398 gpa.free(self.allocatedBytes());390 gpa.free(self.allocatedBytes());
...@@ -411,11 +403,7 @@ pub fn MultiArrayList(comptime S: type) type {...@@ -411,11 +403,7 @@ pub fn MultiArrayList(comptime S: type) type {
411 inline for (fields) |field_info, i| {403 inline for (fields) |field_info, i| {
412 if (@sizeOf(field_info.field_type) != 0) {404 if (@sizeOf(field_info.field_type) != 0) {
413 const field = @intToEnum(Field, i);405 const field = @intToEnum(Field, i);
414 // TODO we should be able to use std.mem.copy here but it causes a406 mem.copy(field_info.field_type, result_slice.items(field), self_slice.items(field));
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);
419 }407 }
420 }408 }
421 return result;409 return result;