Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Oct 7, 2025

Backport of #120435 to release/10.0

/cc @jakobbotsch

Customer Impact

  • Customer reported
  • Found internally

The JIT may internally produce invalid IR for Unsafe.As or Unsafe.BitCast that reinterprets locals from Vector2 to long or double, provided that local was promoted by the JIT (had its X/Y fields treated as separate variables). The invalid IR can lead to silent bad codegen or crashes in release builds of the runtime. Reported by customer in #120414.

Regression

  • Yes
  • No

The relevant code exists in .NET 9 as well.

Testing

Unit test added.

Risk

Low. Add additional condition to an optimization sometimes made by the JIT.

The bitcast transformation produces `BITCAST(LCL_VAR)`, but for SIMDs
the local can be promoted and this ends up resulting in invalid IR. We
would normally go through the `LCL_FLD` path that DNERs the local, so
make sure we still do that.
@jakobbotsch jakobbotsch requested a review from a team October 7, 2025 13:02
@JulieLeeMSFT JulieLeeMSFT added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI Servicing-consider Issue for next servicing release review labels Oct 7, 2025
@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.

@JulieLeeMSFT JulieLeeMSFT added this to the 10.0.0 milestone Oct 7, 2025
@agocke agocke added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 10, 2025
@agocke agocke merged commit 92036e4 into release/10.0 Oct 10, 2025
112 of 117 checks passed
@agocke agocke deleted the backport/pr-120435-to-release/10.0 branch October 10, 2025 21:18
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2025
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 Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants