Fix VSO bug 405852.
authorPat Gavlin <pagavlin@microsoft.com>
Mon, 10 Apr 2017 21:17:08 +0000 (14:17 -0700)
committerPat Gavlin <pagavlin@microsoft.com>
Mon, 10 Apr 2017 21:17:08 +0000 (14:17 -0700)
commit7e999306a4cefcf6e27ad7e4eee08b3f63520b60
tree6bf27b1d34fcb4666211bb0efd205fa106e29711
parent9e037d996c7f4f61676a18bfe4adb782a5203cf6
Fix VSO bug 405852.

This bug was due to a mismatch between the semantics of the FP modulus
operator as specified by ECMA-335 and as implemented by value numbering.

ECMA-335 requires the following behavior for FP modulus:
- If the divisor is 0 or the dividend is not finite, the result is NaN
- If the divisor is not finite and is not NaN, the result is the
  dividend.
Value numbering, however, simply used `fmod`, which does not have these
semantics. This change implements the required semantics in VN.

Commit migrated from https://github.com/dotnet/coreclr/commit/504dcd7001fcdf4e6dd9ff5e6084432589a115a8
src/coreclr/src/jit/valuenum.cpp
src/coreclr/tests/src/JIT/Regression/JitBlue/DevDiv_405852/DevDiv_405852.il [new file with mode: 0644]
src/coreclr/tests/src/JIT/Regression/JitBlue/DevDiv_405852/DevDiv_405852.ilproj [new file with mode: 0644]