You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JIT: (bug) dominator-based jump threading in redundantbranchopts drops a mandatory DivideByZeroException #133982
optRedundantBranch -> optJumpThreadDom can thread flow around a BBJ_COND block whose JTRUE tree has a GTF_EXCEPT side effect that the dominating compare does not cover, orphaning the exception-raising IR. A mandatory DivideByZeroException is silently dropped.
The division is gone from the codegen entirely and V02 arg2 (c) is zero-ref.
Notes
Deterministic; reproduces with default tiering as well as DOTNET_TieredCompilation=0. Also reproduces on released .NET 10.0.12, so it is not a main-only regression.
Root cause: the two relops are matched on their normal VNs only (both sides go through VNUnpackExc), so the dominated relop's exception set can be a strict superset of the dominating one's. optJumpThreadCheck nonetheless grants a blanket exemption to a GTF_EXCEPT-only JTRUE tree, commenting that the exceptions "are covered by the exception effects in the dominating compare... because the VNs match". The non-threading branch-folding path in the same function gets this right by testing vnStore->VNExcIsSubset(domCmpExcVN, treeExcVN) first; the jump-threading path should do the same (or bail out).
changed the title [-]JIT (bug): dominator-based jump threading in redundantbranchopts drops a mandatory DivideByZeroException[/-][+]JIT: (bug) dominator-based jump threading in redundantbranchopts drops a mandatory DivideByZeroException[/+]on Sep 16, 2026
Activity
dotnet-policy-service commentedon Sep 15, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
[-]JIT (bug): dominator-based jump threading in redundantbranchopts drops a mandatory DivideByZeroException[/-][+]JIT: (bug) dominator-based jump threading in redundantbranchopts drops a mandatory DivideByZeroException[/+]EgorBo commentedon Sep 18, 2026
Affected SDK versions:
JIT: Preserve exceptions during jump threading (#134279)