Skip to content

Comments

JIT: Fix immediate assert when relocs are enabled#124335

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

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

Conversation

@jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Feb 12, 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 #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
Contributor

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

@jakobbotsch
Copy link
Member Author

PTAL @EgorBo

@jakobbotsch jakobbotsch requested a review from EgorBo February 12, 2026 11: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

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.

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.

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

2 participants