Skip to content

[release/5.0] Backport Fix for Issue 46529 incorrect 64-bit shift result with cast to int#47741

Merged
Anipik merged 2 commits intodotnet:release/5.0from
briansull:fix-46529-5.0
Feb 10, 2021
Merged

[release/5.0] Backport Fix for Issue 46529 incorrect 64-bit shift result with cast to int#47741
Anipik merged 2 commits intodotnet:release/5.0from
briansull:fix-46529-5.0

Conversation

@briansull
Copy link
Contributor

@briansull briansull commented Feb 2, 2021

Incorrect behavior a 64-bit long with shift of 32 or more combined with a cast to int

The JIT generates incorrect code for this code pattern:

(int) (X << C)

where C >= 32 and
and X is anything with a potential side-effect and is 64-bit integer type

Customer Impact

Reported by customer who was migrating to .Net Core from the Desktop runtime.

Regression?

This is a regression that was introduced in the .Net 3.X timeframe by
dotnet/coreclr#19899

Testing

SuperPMI, new unit test, CLR outerloop, asm diffs.

Risk

Low

Fixes issue #47724

Fix for 46529 - Unexpected behaviour of ulong -> int cast
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 2, 2021
@jeffschwMSFT
Copy link
Member

@briansull can you move the template from the issue into the PR? We only consider PRs and not issues when doing servicing reviews. Please ensure to get a CR for this change.

Copy link
Contributor

@sandreenko sandreenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@briansull
Copy link
Contributor Author

@jeffschwMSFT Updated

@briansull briansull added the Servicing-consider Issue for next servicing release review label Feb 8, 2021
@jeffschwMSFT jeffschwMSFT added this to the 5.0.x milestone Feb 8, 2021
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. We will take for consideration for 5.0.x

@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Feb 9, 2021
@leecow leecow modified the milestones: 5.0.x, 5.0.4 Feb 9, 2021
@Anipik Anipik merged commit 236de24 into dotnet:release/5.0 Feb 10, 2021
@briansull
Copy link
Contributor Author

Posted the fix for [release/3.1]
dotnet/coreclr#28146 [release/3.1] Backport the fix for dotnet/runtime issue 46529

@ghost ghost locked as resolved and limited conversation to collaborators Mar 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI Servicing-approved Approved for servicing release

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[release/5.0] Backport Fix for Issue 46529 incorrect 64-bit shift result with cast to int

5 participants