@@ -3235,6 +3235,7 @@ fn airMulDivBinOp(self: *Self, inst: Air.Inst.Index) !void {
32353235 var callee_buf: ["__udiv?i3".len]u8 = undefined;
32363236 const signed_div_floor_state: struct {
32373237 frame_index: FrameIndex,
3238+ state: State,
32383239 reloc: Mir.Inst.Index,
32393240 } = if (signed and tag == .div_floor) state: {
32403241 const frame_index = try self.allocFrameIndex(FrameAlloc.initType(Type.usize, mod));
@@ -3295,9 +3296,10 @@ fn airMulDivBinOp(self: *Self, inst: Air.Inst.Index) !void {
32953296 tmp_reg,
32963297 mat_rhs_mcv.register_pair[1],
32973298 );
3299+ const state = try self.saveState();
32983300 const reloc = try self.asmJccReloc(.ns, undefined);
32993301
3300- break :state .{ .frame_index = frame_index, .reloc = reloc };
3302+ break :state .{ .frame_index = frame_index, .state = state, . reloc = reloc };
33013303 } else undefined;
33023304 const call_mcv = try self.genCall(
33033305 .{ .lib = .{
@@ -3328,6 +3330,12 @@ fn airMulDivBinOp(self: *Self, inst: Air.Inst.Index) !void {
33283330 .base = .{ .frame = signed_div_floor_state.frame_index },
33293331 .mod = .{ .rm = .{ .size = .byte } },
33303332 });
3333+ try self.restoreState(signed_div_floor_state.state, &.{}, .{
3334+ .emit_instructions = true,
3335+ .update_tracking = true,
3336+ .resurrect = true,
3337+ .close_scope = true,
3338+ });
33313339 try self.performReloc(signed_div_floor_state.reloc);
33323340 const dst_mcv = try self.genCall(
33333341 .{ .lib = .{
0 commit comments