zig

fork of https://codeberg.org/ziglang/zig
Log | Tree | Refs | README | LICENSE

commit c619551f7d0aae794d628fc7d2f34cfc70f1cba3 (tree)
parent 6235762c095e0031b4d5c3da1687f184a2125988
Author: Jacob Young <jacobly0@users.noreply.github.com>
Date:   Mon,  5 Feb 2024 06:55:22 +0100

x86_64: fix incorrect alignment check

Diffstat:
Msrc/arch/x86_64/CodeGen.zig | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig @@ -13715,7 +13715,9 @@ fn genSetReg(self: *Self, dst_reg: Register, ty: Type, src_mcv: MCValue) InnerEr .load_frame => |frame_addr| try self.moveStrategy( ty, dst_reg.class(), - self.getFrameAddrAlignment(frame_addr).compare(.gte, ty.abiAlignment(mod)), + self.getFrameAddrAlignment(frame_addr).compare(.gte, Alignment.fromLog2Units( + std.math.log2_int_ceil(u10, @divExact(dst_reg.bitSize(), 8)), + )), ), .lea_frame => .{ .move = .{ ._, .lea } }, else => unreachable,