Skip to content

Conversation

@jakobbotsch
Copy link
Member

Backport of #119328 to release/10.0

Customer Impact

  • Customer reported
  • Found internally

Potential bad codegen when an 8 byte struct is classified as being passed in a double register on arm32. If the JIT ends up with an operand that is in integer registers, then it produces an invalid IR that it is not prepared to handle.

Regression

  • Yes
  • No

Testing

Existing stress testing revealed the issue in #119062, and the fix was verified on that test.

Risk

Low

On 32-bit platforms we can end up with long operands to a function
taking a parameter in a double. We would try to create bitcasts for this
cast.

Generalize a condition to properly detect this unsupported case.
Copilot AI review requested due to automatic review settings September 5, 2025 11:38
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 backport PR fixes a JIT compiler issue on ARM32 where bad codegen could occur when an 8-byte struct is classified as being passed in a double register but the operand is in integer registers. The fix prevents invalid IR generation by adding checks for unsupported argument conversion cases.

Key changes:

  • Removes an assertion that was too restrictive for certain struct passing scenarios
  • Adds validation to prevent unsupported int-to-float register conversions that require insertions

@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 Sep 5, 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.

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. please get a code review. we can merge when ready

@jakobbotsch
Copy link
Member Author

/ba-g Android timeout failure

@jeffschwMSFT jeffschwMSFT merged commit facd855 into dotnet:release/10.0 Sep 11, 2025
99 of 102 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2025
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

None yet

Development

Successfully merging this pull request may close these issues.

3 participants