Skip to content

JIT: Preserve overflow checks when folding scaled indexes - #133802

Open
EgorBo wants to merge 1 commit into
dotnet:mainfrom
EgorBo:fix-jit-133782
Open

JIT: Preserve overflow checks when folding scaled indexes#133802
EgorBo wants to merge 1 commit into
dotnet:mainfrom
EgorBo:fix-jit-133782

Conversation

@EgorBo

@EgorBo EgorBo commented Sep 12, 2026

Copy link
Copy Markdown
Member

Fixes #133782

Preserve checked multiplies during address-mode folding.

Fixes dotnet#133782

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 5652b860-d333-435d-84bc-ad96d9d203e0
Copilot AI lite review requested due to automatic review settings September 12, 2026 21:23
@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 12, 2026
@azure-pipelines

Copy link
Copy Markdown
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.

@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.

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.

🟡 Changes recommended

A critical folding path can still discard a checked multiply and suppress the required OverflowException.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR addresses a CoreCLR JIT bug involving overflow checks during scaled-index folding.

Changes:

  • Excludes checked multiplications from scaled-index folding.
  • Adds regression coverage for operand order, integer types, and overflow behavior.

A critical issue remains: later folding paths can still discard checked multiplications and suppress OverflowException.

File summaries
File Reviewed change
src/tests/JIT/Regression_ro_2/Runtime_133782.cs Adds regression tests for checked scaled multiplication and overflow behavior.
src/coreclr/jit/gentree.cpp Prevents checked multiplications from scaled-index recognition, but later folding paths remain unguarded.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/coreclr/jit/gentree.cpp
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.

JIT: (bug) LEA address-mode folding silently deletes a nested checked multiply (missing OverflowException)

2 participants