| author | |
| committer | |
| log | 50f96c2949bd7d396eaaf391ffd5fd55e59ebac1 |
| tree | c5302677eecf012d7d83da4f3b51578767b87c0f |
| parent | db76ae82607b941373064b05a348950802a21217 |
2 files changed, 4 insertions(+), 8 deletions(-)
src/arch/x86_64/CodeGen.zig+4-3| ... | @@ -1673,15 +1673,16 @@ fn allocFrameIndex(self: *Self, alloc: FrameAlloc) !FrameIndex { | ... | @@ -1673,15 +1673,16 @@ fn allocFrameIndex(self: *Self, alloc: FrameAlloc) !FrameIndex { |
| 1673 | const frame_allocs_slice = self.frame_allocs.slice(); | 1673 | const frame_allocs_slice = self.frame_allocs.slice(); |
| 1674 | const frame_size = frame_allocs_slice.items(.abi_size); | 1674 | const frame_size = frame_allocs_slice.items(.abi_size); |
| 1675 | const frame_align = frame_allocs_slice.items(.abi_align); | 1675 | const frame_align = frame_allocs_slice.items(.abi_align); |
| 1676 | |||
| 1677 | const stack_frame_align = &frame_align[@enumToInt(FrameIndex.stack_frame)]; | ||
| 1678 | stack_frame_align.* = @max(stack_frame_align.*, alloc.abi_align); | ||
| 1679 | |||
| 1676 | for (self.free_frame_indices.keys(), 0..) |frame_index, free_i| { | 1680 | for (self.free_frame_indices.keys(), 0..) |frame_index, free_i| { |
| 1677 | const abi_size = frame_size[@enumToInt(frame_index)]; | 1681 | const abi_size = frame_size[@enumToInt(frame_index)]; |
| 1678 | if (abi_size != alloc.abi_size) continue; | 1682 | if (abi_size != alloc.abi_size) continue; |
| 1679 | const abi_align = &frame_align[@enumToInt(frame_index)]; | 1683 | const abi_align = &frame_align[@enumToInt(frame_index)]; |
| 1680 | abi_align.* = @max(abi_align.*, alloc.abi_align); | 1684 | abi_align.* = @max(abi_align.*, alloc.abi_align); |
| 1681 | 1685 | ||
| 1682 | const stack_frame_align = &frame_align[@enumToInt(FrameIndex.stack_frame)]; | ||
| 1683 | stack_frame_align.* = @max(stack_frame_align.*, alloc.abi_align); | ||
| 1684 | |||
| 1685 | _ = self.free_frame_indices.swapRemoveAt(free_i); | 1686 | _ = self.free_frame_indices.swapRemoveAt(free_i); |
| 1686 | return frame_index; | 1687 | return frame_index; |
| 1687 | } | 1688 | } |
test/behavior/align.zig-5| ... | @@ -282,7 +282,6 @@ fn give() anyerror!u128 { | ... | @@ -282,7 +282,6 @@ fn give() anyerror!u128 { |
| 282 | 282 | ||
| 283 | test "page aligned array on stack" { | 283 | test "page aligned array on stack" { |
| 284 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 284 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 285 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; | ||
| 286 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 285 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 287 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 286 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 288 | 287 | ||
| ... | @@ -491,10 +490,6 @@ test "read 128-bit field from default aligned struct in global memory" { | ... | @@ -491,10 +490,6 @@ test "read 128-bit field from default aligned struct in global memory" { |
| 491 | } | 490 | } |
| 492 | 491 | ||
| 493 | test "struct field explicit alignment" { | 492 | test "struct field explicit alignment" { |
| 494 | if (builtin.zig_backend == .stage2_x86_64) { | ||
| 495 | // Careful enabling this test, fails randomly. | ||
| 496 | return error.SkipZigTest; | ||
| 497 | } | ||
| 498 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; | 493 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 499 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; | 494 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; |
| 500 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 495 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |