From 8311fac7e853f7e8454e79794ab9060a488a7875 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Sun, 5 Nov 2023 05:15:35 -0500 Subject: [PATCH] x86_64: fix indirect return of `f80` --- src/arch/x86_64/CodeGen.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig index 295601c20737f553af18bd7a8640ac652bde1a37..9d4ee182c4f44bd40019c71e03423f14f7922cec 100644 --- a/src/arch/x86_64/CodeGen.zig +++ b/src/arch/x86_64/CodeGen.zig @@ -10885,12 +10885,12 @@ fn airRet(self: *Self, inst: Air.Inst.Index) !void { else => unreachable, } self.ret_mcv.liveOut(self, inst); + try self.finishAir(inst, .unreach, .{ un_op, .none, .none }); // TODO optimization opportunity: figure out when we can emit this as a 2 byte instruction // which is available if the jump is 127 bytes or less forward. const jmp_reloc = try self.asmJmpReloc(undefined); try self.exitlude_jump_relocs.append(self.gpa, jmp_reloc); - return self.finishAir(inst, .unreach, .{ un_op, .none, .none }); } fn airRetLoad(self: *Self, inst: Air.Inst.Index) !void { @@ -10905,12 +10905,12 @@ fn airRetLoad(self: *Self, inst: Air.Inst.Index) !void { else => unreachable, } self.ret_mcv.liveOut(self, inst); + try self.finishAir(inst, .unreach, .{ un_op, .none, .none }); // TODO optimization opportunity: figure out when we can emit this as a 2 byte instruction // which is available if the jump is 127 bytes or less forward. const jmp_reloc = try self.asmJmpReloc(undefined); try self.exitlude_jump_relocs.append(self.gpa, jmp_reloc); - return self.finishAir(inst, .unreach, .{ un_op, .none, .none }); } fn airCmp(self: *Self, inst: Air.Inst.Index, op: math.CompareOperator) !void { -- 2.54.0