From b0cf620fe3032d485b581c8ab6239f719ef2cada Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Fri, 27 Oct 2023 01:40:14 -0400 Subject: x86_64: fix `cond_br` --- src/arch/x86_64/CodeGen.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig index 8b65f17aea..c18aa94716 100644 --- a/src/arch/x86_64/CodeGen.zig +++ b/src/arch/x86_64/CodeGen.zig @@ -10627,8 +10627,6 @@ fn airCondBr(self: *Self, inst: Air.Inst.Index) !void { const else_body = self.air.extra[extra.end + then_body.len ..][0..extra.data.else_body_len]; const liveness_cond_br = self.liveness.getCondBr(inst); - const reloc = try self.genCondBrMir(cond_ty, cond); - // If the condition dies here in this condbr instruction, process // that death now instead of later as this has an effect on // whether it needs to be spilled in the branches @@ -10638,6 +10636,7 @@ fn airCondBr(self: *Self, inst: Air.Inst.Index) !void { self.scope_generation += 1; const state = try self.saveState(); + const reloc = try self.genCondBrMir(cond_ty, cond); for (liveness_cond_br.then_deaths) |death| try self.processDeath(death); try self.genBody(then_body); -- cgit v1.2.3