Skip to content

Fix for 46529 - Unexpected behaviour of ulong -> int cast#47418

Merged
briansull merged 2 commits intodotnet:masterfrom
briansull:issue-46529
Jan 26, 2021
Merged

Fix for 46529 - Unexpected behaviour of ulong -> int cast#47418
briansull merged 2 commits intodotnet:masterfrom
briansull:issue-46529

Conversation

@briansull
Copy link
Contributor

Move check for side-effect and don't push the cast down for shifts of 32 to 63
Added test Runtime_46239.cs

Move check for side-effect and don't push the cast for shifts of 32 to 63
Added test Runtime_46239.cs
@ghost
Copy link

ghost commented Jan 25, 2021

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@briansull briansull linked an issue Jan 25, 2021 that may be closed by this pull request
@briansull
Copy link
Contributor Author

Fixes #46529

@briansull
Copy link
Contributor Author

@dotnet/jit-contrib PTAL

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

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

LGTM.

@JulieLeeMSFT JulieLeeMSFT added this to the 6.0.0 milestone Jan 25, 2021
@JulieLeeMSFT JulieLeeMSFT added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 25, 2021
@briansull briansull merged commit caf36fa into dotnet:master Jan 26, 2021
@AndyAyersMS
Copy link
Member

@briansull @JulieLeeMSFT this looks like a good candidate for both 5.0 and 3.1 servicing...

@briansull
Copy link
Contributor Author

/backport to release/5.0

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2021

Started backporting to release/5.0: https://github.com/dotnet/runtime/actions/runs/529711052

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2021

@briansull backporting to release/5.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix for issue 46529 Move check for side-effect and don't push the cast for shifts of 32 to 63 Added test Runtime_46239.cs
error: sha1 information is lacking or useless (src/coreclr/jit/morph.cpp).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix for issue 46529 Move check for side-effect and don't push the cast for shifts of 32 to 63 Added test Runtime_46239.cs
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@briansull
Copy link
Contributor Author

briansull commented Feb 2, 2021

This regression was introduced by
dotnet/coreclr#19899
Fix optimization of CAST(int)(LSH(long)<<CNS_INT 32+ with side effects).

@ghost ghost locked as resolved and limited conversation to collaborators Mar 4, 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

Projects

None yet

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

3 participants