Skip to content

Conversation

@jakobbotsch
Copy link
Member

Explicit tailcalls are not allowed out of async methods so it does not make sense to allow turning on tailcall stress. Turning it on also impacts IR created because we we may skip creating some GT_RETURN nodes, which is not expected by async transformations.

Fix #122632

Explicit tailcalls are not allowed out of async methods so it does not
make sense to allow turning on tailcall stress. Turning it on also
impacts IR created because we we may skip creating some `GT_RETURN`
nodes, which is not expected by async transformations.
Copilot AI review requested due to automatic review settings January 5, 2026 12:36
@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 Jan 5, 2026
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 issue #122632 by disabling tailcall stress mode for async methods. Since explicit tailcalls are not allowed out of async methods (they need to restore contexts), it doesn't make sense to enable tailcall stress mode in these methods. Enabling tailcall stress in async methods can also cause issues with IR creation, as some GT_RETURN nodes may be skipped, which is not expected by async transformations.

Key Changes

  • Added !compIsAsync() check to compTailCallStress() to prevent tailcall stress mode from being enabled in async methods
  • Added explanatory comment documenting why tailcalls are not allowed in async methods

@jakobbotsch
Copy link
Member Author

PTAL @dotnet/jit-contrib

@jakobbotsch jakobbotsch requested a review from a team January 5, 2026 16:16
@jakobbotsch
Copy link
Member Author

/ba-g iOS dead letter

@jakobbotsch jakobbotsch merged commit dbb83fc into dotnet:main Jan 6, 2026
127 of 129 checks passed
@jakobbotsch jakobbotsch deleted the fix-122632 branch January 6, 2026 12:59
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

Development

Successfully merging this pull request may close these issues.

Test failure: async/collectible-alc/collectible-alc/collectible-alc.cmd

2 participants