mirror of
https://github.com/ziglang/zig.git
synced 2024-11-21 19:42:56 +00:00
riscv64: Handle writes to the zero register sensibly in result bookkeeping.
This commit is contained in:
parent
dfd203609d
commit
cc507c5024
@ -1811,8 +1811,15 @@ fn finishAirBookkeeping(func: *Func) void {
|
||||
fn finishAirResult(func: *Func, inst: Air.Inst.Index, result: MCValue) void {
|
||||
if (func.liveness.isUnused(inst)) switch (result) {
|
||||
.none, .dead, .unreach => {},
|
||||
else => unreachable, // Why didn't the result die?
|
||||
// Why didn't the result die?
|
||||
.register => |r| if (r != .zero) unreachable,
|
||||
else => unreachable,
|
||||
} else {
|
||||
switch (result) {
|
||||
.register => |r| if (r == .zero) unreachable, // Why did we discard a used result?
|
||||
else => {},
|
||||
}
|
||||
|
||||
tracking_log.debug("%{d} => {} (birth)", .{ inst, result });
|
||||
func.inst_tracking.putAssumeCapacityNoClobber(inst, InstTracking.init(result));
|
||||
// In some cases, an operand may be reused as the result.
|
||||
|
Loading…
Reference in New Issue
Block a user