Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Narrow cast fix #70518

Merged
merged 13 commits into from
Jun 16, 2022
Prev Previous commit
Next Next commit
Fixing build
  • Loading branch information
TIHan committed Jun 13, 2022
commit 9926179b3805bb97e2c9ce27700227f871fd3d0e
6 changes: 3 additions & 3 deletions src/coreclr/jit/flowgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,13 +752,13 @@ bool Compiler::fgIsSafeToRemoveIntToIntCastOnAssignment(GenTree* tree)
if (gtIsActiveCSE_Candidate(cast->CastOp()))
return false;

if (!varTypeIsIntegral(castToType))
if (!varTypeIsSmall(effectiveOp1))
return false;

if (!varTypeIsIntegral(castFromType))
if (!varTypeIsSmall(castToType))
return false;

if (!varTypeIsIntegral(effectiveOp1))
if (!varTypeIsIntegral(castFromType))
TIHan marked this conversation as resolved.
Show resolved Hide resolved
return false;

// If we are performing a narrowing cast and
Expand Down