[release/10.0-preview3] JIT: Don't use checked bounds in assertprop #113656
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.
Backport of #113638 to release/10.0-preview3
Please accept a bug-fix for a bug that sneaked into Preview3 - nobody hit it yet (except for jitstress pipeline in Main), but I suspect it might show up (some conditions folded as true/false when they shouldn't).
/cc @EgorBo
Customer Impact
A new optimization in 10.0 P3 could fold conditions based on the mechanism that is used by Bounds Check Elimination (BCE). That mechanism contained a pre-existing "potential" bug (we're not sure) that in the worst case could remove a bounds check where it shouldn't (but we suspect it doesn't happen today). The bug manifested itself as real test failures #113049 and #113052 when we started to use this mechanism outside of BCE recently. It may result in taking conditional branches that should not be taken (e.g. unexpected exception is thrown).
Regression
The regression was introduced in 10.0 P3
Testing
jitstress. The fix basically disables some recently introduced optimizations.
Risk
Low