mirror of
https://github.com/ziglang/zig.git
synced 2025-12-16 11:13:08 +00:00
make it more clear we should do UB wrapping optimizations for ptr arithmetic
This commit is contained in:
parent
ad4627ea3b
commit
dffa6dcaf9
@ -1123,15 +1123,14 @@ fn genBody(f: *Function, body: []const Air.Inst.Index) error{ AnalysisFail, OutO
|
||||
.unreach => try airUnreach(f),
|
||||
.fence => try airFence(f, inst),
|
||||
|
||||
.ptr_add => try airPtrAddSub (f, inst, " + "),
|
||||
.ptr_sub => try airPtrAddSub (f, inst, " - "),
|
||||
|
||||
// TODO use a different strategy for add that communicates to the optimizer
|
||||
// that wrapping is UB.
|
||||
.add => try airBinOp (f, inst, " + "),
|
||||
.ptr_add => try airPtrAddSub (f, inst, " + "),
|
||||
// TODO use a different strategy for sub that communicates to the optimizer
|
||||
// that wrapping is UB.
|
||||
.sub => try airBinOp (f, inst, " - "),
|
||||
.ptr_sub => try airPtrAddSub (f, inst, " - "),
|
||||
// TODO use a different strategy for mul that communicates to the optimizer
|
||||
// that wrapping is UB.
|
||||
.mul => try airBinOp (f, inst, " * "),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user