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) value numbering asserts when constant-folding 64-bit PopCount/LeadingZeroCount/TrailingZeroCount #133560
The importer already folds operands that are constant at import time, so the constant has
to appear later: y - y is folded to zero by value numbering itself, producing a ulong
constant at exactly the right moment.
Expected
1
55
8
Actual
Assert failure(PID 114088 [0x0001bda8], Thread: 109036 [0x1a9ec]): Assertion failed 'typ == TYP_INT' in 'Program:TestPopCount(ulong):ulong' during 'Do value numbering' (IL size 16; hash 0xd7ae60ea; FullOpts)
File: C:\prj\runtime-main3\src\coreclr\jit\valuenum.cpp:10348
The process aborts with exit code 0xC0000602. TestLeadingZeroCount and TestTrailingZeroCount fail at the same assert.
Platform
Windows x64 host, local Checked build of dotnet/runtime main (ef97eb5).
Requires a Checked/Debug JIT for a target that does not turn the 64-bit bit-counting
primitives into a hardware intrinsic, so the node keeps its TYP_LONG result type.
Observed by cross-compiling with the WASM alt-JIT:
set DOTNET_AltJit=TestPopCount
set DOTNET_AltJitName=clrjit_universal_wasm_x64.dll
x64 and arm64 are unaffected — they lower these to hardware instructions and produce the
expected output.
Activity
dotnet-policy-service commentedon Sep 10, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
JIT: Preserve 64-bit bit-count value numbers (#133727)
JIT: Preserve 64-bit bit-count value numbers (dotnet#133727)