Cast gtIconVal to target_ssize_t in src/jit/assertionprop.cpp
authorEgor Chesakov <Egor.Chesakov@microsoft.com>
Wed, 29 Aug 2018 01:24:57 +0000 (18:24 -0700)
committerEgor Chesakov <Egor.Chesakov@microsoft.com>
Wed, 29 Aug 2018 01:50:40 +0000 (18:50 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/9e32ef351092acdde970d1a9a80fa6565bf01456

src/coreclr/src/jit/assertionprop.cpp

index 5e00ef9..8bc83fe 100644 (file)
@@ -1115,7 +1115,9 @@ AssertionIndex Compiler::optCreateAssertion(GenTree*         op1,
                             goto DONE_ASSERTION;
                         }
                         // Do not Constant-Prop large constants for ARM
-                        if (!codeGen->validImmForMov(op2->gtIntCon.gtIconVal))
+                        // TODO-CrossBitness: we wouldn't need the cast below if GenTreeIntCon::gtIconVal had
+                        // target_ssize_t type.
+                        if (!codeGen->validImmForMov((target_ssize_t)op2->gtIntCon.gtIconVal))
                         {
                             goto DONE_ASSERTION; // Don't make an assertion
                         }