Skip to content

Conversation

@jakobbotsch
Copy link
Member

Otherwise we may end up with mask registers in this mask, and passing that to genFindLowestBit hits asserts. We are in any case only interested in integer registers here, so limit it to that.

Fix #118925

Otherwise we may end up with mask registers in this mask, and passing
that to `genFindLowestBit` hits asserts. We are in any case only
interested in integer registers here, so limit it to that.
@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 Aug 21, 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.

@jakobbotsch jakobbotsch marked this pull request as ready for review August 21, 2025 14:07
Copilot AI review requested due to automatic review settings August 21, 2025 14:07
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 a JIT (Just-In-Time compiler) issue where mask registers could incorrectly be included when searching for temporary registers during prolog generation, causing assertion failures in genFindLowestBit. The fix restricts the search to only integer registers by applying the RBM_ALLINT mask.

  • Adds filtering to ensure only integer registers are considered for temporary register allocation
  • Prevents mask registers from being passed to genFindLowestBit which expects integer registers only

@jakobbotsch
Copy link
Member Author

PTAL @dotnet/jit-contrib. No diffs. Just fixes an assert when we have TYP_MASK locals whose registers end up in the set here.

No need to backport this, the assert that triggers is harmless.

@jakobbotsch jakobbotsch requested a review from a team August 21, 2025 14:08
Copy link
Member

@tannergooding tannergooding left a comment

Choose a reason for hiding this comment

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

Are there any other places where we might not be filtering out float or mask registers that we should?

I know I've found a few places over time (and fixed them as encountered) where we basically did things like assume !isFloatReg meant must be an integer register and similar.

@jakobbotsch
Copy link
Member Author

Are there any other places where we might not be filtering out float or mask registers that we should?

I audited a few files but couldn't find other cases... I guess we will see when we hit them.

@jakobbotsch jakobbotsch merged commit bd94b14 into dotnet:main Aug 22, 2025
113 checks passed
@jakobbotsch jakobbotsch deleted the fix-118925 branch August 22, 2025 07:41
@github-actions github-actions bot locked and limited conversation to collaborators Sep 21, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JIT: [runtime async] Assertion failed 'value.getHigh() == RBM_NONE' during 'Generate code'

2 participants