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

[release/5.0] Fix regression with tail.callvirt transformation to helper call #45880

Merged
merged 3 commits into from
Dec 11, 2020

Conversation

echesakov
Copy link
Contributor

Backport of #45527 to release/5.0

Customer Impact

The original issue was reported by @KevinRansom - F# 5.0.100 was broken for Linux Arm32 (dotnet/fsharp#10454). He also constructed a short F# repro exposing the bug in #45250.
Later, I discovered that the issue can be reproduced on all platforms if fast tail calls are either disabled or disallowed (e.g. when localloc is used in the caller method).

The issue impacts F# applications with the following code pattern

call       #<method returns object reference and has side effects>
tail.
callvirt   #<virtual generic method>

and results in side effects being computed twice when such code is transformed to tail call with helpers.

Testing

Constructed a regression test in IL that exposes the failing code pattern (see Runtime_45250.il). Confirmed that the test would fail on all platforms due to incorrect JIT transformation (bad silent codegen). Verified that the change fixes the issue. Ran Pri1 tests in various jit-stress modes. Manually collected the code differences introduced by the change and analyzed some of the differences.

Risk

Low.

Regression

Yes from 3.1, introduced when runtime switched to using tail call with portable helpers.

@echesakov echesakov added this to the 5.0.x milestone Dec 10, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Dec 10, 2020
@echesakov echesakov linked an issue Dec 10, 2020 that may be closed by this pull request
@echesakov
Copy link
Contributor Author

@dotnet/jit-contrib PTAL

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. I will take it for potential approval for 5.0.2

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Dec 10, 2020
@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Dec 10, 2020
@leecow leecow modified the milestones: 5.0.x, 5.0.2 Dec 10, 2020
@Anipik Anipik merged commit 85e6fa7 into dotnet:release/5.0 Dec 11, 2020
@echesakov echesakov deleted the Rel5.0-Runtime_45250 branch December 11, 2020 21:10
@ghost ghost locked as resolved and limited conversation to collaborators Jan 10, 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 regression-from-last-release Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jit codegen for ARM32 produces incorrect behaviour
6 participants