Skip to content

Conversation

@jakobbotsch
Copy link
Member

Fix #113940

Copilot AI review requested due to automatic review settings August 11, 2025 14:54
@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 11, 2025
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 issue #113940 by preventing the creation of impossible equality assertions in the JIT compiler's assertion propagation optimization. The fix addresses cases where a small local variable (like byte or short) would be compared to a constant value outside its valid range, which would create impossible assertions that could cause problems elsewhere in the compiler.

  • Adds validation to detect when a truncated constant value differs from the original value for small local variables
  • Avoids creating assertions for impossible equality comparisons that indicate unreachable code
  • Maintains existing behavior for store operations while fixing the issue for other operations

@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

cc @dotnet/jit-contrib PTAL @EgorBo

@jakobbotsch jakobbotsch requested a review from EgorBo August 11, 2025 14:55
Copy link
Member

@EgorBo EgorBo left a comment

Choose a reason for hiding this comment

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

LGTM

@jakobbotsch
Copy link
Member Author

No diffs

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: Assertion failed 'FitsIn(tree->TypeGet(), value)' during 'Assertion prop'

2 participants