News

Rust 1.97.1 Patches LLVM Miscompilation That Dates Back to 1.87

Rust's latest point release fixes a miscompilation in an LLVM optimization, with the underlying bug present since at least Rust 1.87. The fix includes both an LLVM backport and a disable of the IR change that increased the likelihood of the issue.

August 5, 2026· 1 min read
Rust 1.97.1 Patches LLVM Miscompilation That Dates Back to 1.87

The Rust team shipped Rust 1.97.1, a point release that addresses a miscompilation in an LLVM optimization. The bug, tracked in issue #159035, has been present since at least Rust 1.87, meaning users on stable releases for the past several months may have been affected without knowing it.

The fix is twofold: the Rust team backported an LLVM fix and disabled a change in Rust 1.97.0's generated IR that increased the likelihood of the miscompilation occurring. This suggests the root cause lies in how Rust's IR interacts with LLVM's optimization passes, and the team chose to be conservative by disabling the IR change rather than risk further issues.

For developers, the immediate action is straightforward: run rustup update stable to get the patched version. But the longer-term takeaway is that miscompilations can lurk in release channels for months, and testing with beta or nightly channels can help catch such issues earlier.

The Rust team encourages users to run their CI on beta or nightly (rustup default beta or rustup default nightly) and report any bugs they encounter.

The underlying miscompilation has been present since at least Rust 1.87 — if you've seen weird behavior in optimized builds, this could be the culprit.
Manul X Editorial