Repository navigation
JIT: spill pending side effects before signed Log2 expansion - #135834
Merged
Merged
Conversation
The signed Log2 expansion stores a QMARK whose fallback throws ArgumentOutOfRangeException (GTF_CALL | GTF_EXCEPT) to a temp, but appended it with CHECK_SPILL_NONE. Side-effecting entries still on the IL stack (calls, bounds checks of earlier operands) were then evaluated after the throw. Use CHECK_SPILL_ALL so they are spilled first. Fixes dotnet#135816 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6ec7c151-8b7f-4bf9-8b1a-8c601a2965ec
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix uses the existing ordering mechanism and includes regression coverage for the reported failures.
0 open findings
What changed in this PR
Fixes signed Log2 evaluation order so earlier operands execute before its negative-argument exception.
Changes:
- Uses the importer’s existing spill mechanism to preserve pending side effects.
- Adds regression coverage for skipped calls and exception ordering with
intandlong.
Builds and tests were not run.
| File | Description |
|---|---|
| src/tests/JIT/Regression_ro_2/Runtime_135816.cs | Tests side effects and exception ordering. |
| src/coreclr/jit/importercalls.cpp | Uses CHECK_SPILL_ALL before storing the signed Log2 expansion. |
🧠 Review effort: Balanced
This was referenced Oct 15, 2026
Open
Closed
Member
Author
|
PTAL @dotnet/jit-contrib, trivial change, no diffs |
tannergooding
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The signed Log2 expansion stores a QMARK whose fallback throws ArgumentOutOfRangeException (GTF_CALL | GTF_EXCEPT) to a temp, but appended it with CHECK_SPILL_NONE. Side-effecting entries still on the IL stack (calls, bounds checks of earlier operands) were then evaluated after the throw. Use CHECK_SPILL_ALL so they are spilled first.
Fixes #135816
No diffs