Skip to content

JIT: Fix immediate assert when relocs are enabled - #124335

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-124327
Feb 12, 2026
Merged

JIT: Fix immediate assert when relocs are enabled#124335
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-124327

Conversation

@jakobbotsch

@jakobbotsch jakobbotsch commented Feb 12, 2026

Copy link
Copy Markdown
Member

When recording relocations we should not try to emit proper immediates for address computations. Those immediates are meaningless since the address isn't the final location, and they can cause asserts due to not being encodable.

Fix #124327

When recording relocations we should not try to emit proper immediates
for address computations. Those immediates are meaningless since the
address isn't the final location, and they can cause asserts due to not
being encodable.
Copilot AI review requested due to automatic review settings February 12, 2026 11:05
@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 Feb 12, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@jakobbotsch

Copy link
Copy Markdown
Member Author

PTAL @EgorBo

@jakobbotsch
jakobbotsch requested a review from EgorBo February 12, 2026 11:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes ARM64 JIT label-address emission when relocations are being recorded by avoiding computation/encoding of PC-relative immediates that are not meaningful prior to final code placement (and can trip encoding asserts).

Changes:

  • When id->idIsReloc() is set, emit placeholder 0 immediates for adrp page delta and add page offset instead of attempting to encode the not-yet-final address deltas.
  • Continue to record the appropriate ARM64_PAGEBASE_REL21 and ARM64_PAGEOFFSET_12A relocations so the loader/linker can patch the real values.

@jakobbotsch
jakobbotsch merged commit 0c7ef81 into dotnet:main Feb 12, 2026
128 of 133 checks passed
@jakobbotsch
jakobbotsch deleted the fix-124327 branch February 12, 2026 18:43
iremyux pushed a commit to iremyux/dotnet-runtime that referenced this pull request Mar 2, 2026
When recording relocations we should not try to emit proper immediates
for address computations. Those immediates are meaningless since the
address isn't the final location, and they can cause asserts due to not
being encodable.

Fix dotnet#124327
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 15, 2026
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.

SPMI: Assertion failed 'isValidSimm<19>(distVal)' in 'Generics+TestAsyncGVMScenarios:AsyncGvm2[System.__Canon]():this'

3 participants