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) int.RotateLeft/RotateRight constant folding creates a non-sign-extended TYP_INT constant, so comparisons against it are folded to the wrong result #135814
impRotateHelper folds RotateLeft/RotateRight(const, const) for 32-bit operands via gtNewIconNode(uint32_t, baseType). When the result has bit 31 set, the TYP_INT constant holds +2147483648 instead of -2147483648, so later phases fold comparisons against it incorrectly.
Test is compiled to xor eax, eax and TestLt to mov eax, 1.
Regression?
Also reproduces on the 10.0.13 release (Test(3) returns False); not re-verified.
Notes
impRotateHelper (importercalls.cpp): uint32_t res = ...; return gtNewIconNode(res, baseType); zero-extends res to ssize_t on 64-bit hosts, but assertion prop / VN range reasoning rely on TYP_INT constants being sign-extended.
Activity
dotnet-policy-service commentedon Oct 14, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
JIT: sign-extend folded 32-bit RotateLeft/RotateRight constants (#135833