add comment
authorHyeongseok Oh <hseok82.oh@samsung.com>
Wed, 7 Sep 2016 04:18:39 +0000 (13:18 +0900)
committerGitHub <noreply@github.com>
Wed, 7 Sep 2016 04:18:39 +0000 (13:18 +0900)
Commit migrated from https://github.com/dotnet/coreclr/commit/1fd05c6120036bf180b595aa2321d8656a02c3d7

src/coreclr/src/jit/gentree.cpp

index 39245ba..dd244b7 100644 (file)
@@ -12049,6 +12049,9 @@ GenTreePtr Compiler::gtFoldExprConst(GenTreePtr tree)
 
                         if (d1 <= -1.0 && varTypeIsUnsigned(tree->CastToType())) 
                         {
+                            // Don't fold conversions of these cases becasue the result is unspecified per ECMA spec
+                            // and the native math doing the fold doesn't match the run-time computation on all platforms.
+                            // We want the behavior to be same with or without folding.
                             return tree;
                         }