Skip to content

Conversation

@jakobbotsch
Copy link
Member

For x86 we only report GC pointers live in callee save registers, and we also avoid reporting any trivial call.
There is compensating code upstream of the GC reporting that returns for trivial calls, but this code did not account for the GC ref returned for async continuations. Thus it was possible that we made it into the GC encoder with a trivial call and then hit an assert.

Fix #121872

For x86 we only report GC pointers live in callee save registers, and we
also avoid reporting any trivial call.
There is compensating code upstream of the GC reporting that returns for
trivial calls, but this code did not account for the GC ref returned for
async continuations. Thus it was possible that we made it into the GC
encoder with a trivial call and then hit an assert.
Copilot AI review requested due to automatic review settings November 24, 2025 23:14
@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 24, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Copilot finished reviewing on behalf of jakobbotsch November 24, 2025 23:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an assertion failure in the GC encoder for x86 when processing trivial async calls. The issue occurred because the code that masks out return registers for GC reporting only accounted for the standard integer return register (EAX), but not the long return register pair (EDX:EAX) or the async continuation return register (ECX). The fix extends the mask to include all three register sets.

@jakobbotsch
Copy link
Member Author

PTAL @dotnet/jit-contrib.

No diffs

@jakobbotsch jakobbotsch requested a review from a team November 25, 2025 08:52
@jakobbotsch jakobbotsch merged commit e2005d1 into dotnet:main Nov 25, 2025
110 of 112 checks passed
@jakobbotsch jakobbotsch deleted the fix-121872 branch November 25, 2025 19:24
MichalStrehovsky added a commit that referenced this pull request Nov 25, 2025
The fix presumably merged in #121941.
MichalStrehovsky added a commit that referenced this pull request Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

2 participants