@@ -102890,9 +102890,6 @@ fn lowerSwitchBr(
102890
102890
const relocs = try allocator.alloc(Mir.Inst.Index, case.items.len + case.ranges.len);
102891
102891
defer allocator.free(relocs);
102892
102892
102893
- var cond_temp = try cg.tempInit(condition_ty, condition);
102894
- const reset_index = cg.next_temp_index;
102895
-
102896
102893
try cg.spillEflagsIfOccupied();
102897
102894
for (case.items, relocs[0..case.items.len]) |item, *reloc| {
102898
102895
const item_mcv = try cg.resolveInst(item);
@@ -102903,6 +102900,7 @@ fn lowerSwitchBr(
102903
102900
else => unreachable,
102904
102901
},
102905
102902
else => cc: {
102903
+ var cond_temp = try cg.tempInit(condition_ty, condition);
102906
102904
var item_temp = try cg.tempInit(condition_ty, item_mcv);
102907
102905
const cc_temp = cond_temp.cmpInts(.eq, &item_temp, cg) catch |err| switch (err) {
102908
102906
error.SelectFailed => unreachable,
@@ -102911,14 +102909,16 @@ fn lowerSwitchBr(
102911
102909
try item_temp.die(cg);
102912
102910
const cc = cc_temp.tracking(cg).short.eflags;
102913
102911
try cc_temp.die(cg);
102914
- try cg.resetTemps(reset_index);
102912
+ try cond_temp.die(cg);
102913
+ try cg.resetTemps(@enumFromInt(0));
102915
102914
break :cc cc;
102916
102915
},
102917
102916
};
102918
102917
reloc.* = try cg.asmJccReloc(cc, undefined);
102919
102918
}
102920
102919
102921
102920
for (case.ranges, relocs[case.items.len..]) |range, *reloc| {
102921
+ var cond_temp = try cg.tempInit(condition_ty, condition);
102922
102922
const min_mcv = try cg.resolveInst(range[0]);
102923
102923
const max_mcv = try cg.resolveInst(range[1]);
102924
102924
// `null` means always false.
@@ -102962,7 +102962,8 @@ fn lowerSwitchBr(
102962
102962
break :cc cc;
102963
102963
},
102964
102964
};
102965
- try cg.resetTemps(reset_index);
102965
+ try cond_temp.die(cg);
102966
+ try cg.resetTemps(@enumFromInt(0));
102966
102967
// "Success" case is in `reloc`....
102967
102968
if (lte_max) |cc| {
102968
102969
reloc.* = try cg.asmJccReloc(cc, undefined);
@@ -102973,8 +102974,6 @@ fn lowerSwitchBr(
102973
102974
if (lt_min_reloc) |r| cg.performReloc(r);
102974
102975
}
102975
102976
102976
- try cond_temp.die(cg);
102977
- try cg.resetTemps(@enumFromInt(0));
102978
102977
cg.checkInvariantsAfterAirInst();
102979
102978
102980
102979
// The jump to skip this case if the conditions all failed.
0 commit comments