Go: Fixing a Silent Data Corruption Bug in MIPS Register Allocation

Developer Jorropo landed two related commits that close out a compiler bug on MIPS and MIPS64 architectures, where multiply and divide results could be silently corrupted during register spilling. The fix removes a risky register-homing pattern rather than patching around it.

Duration: PT2M12S

Episode overview

This episode is a short developer briefing from Go.

It explains recent repository work in plain language.

  • Show: Go
  • Published: 2026-07-26T13:04:30Z
  • Audio duration: PT2M12S

Transcript excerpt

This excerpt keeps the crawler page concise. Listen to the episode or use the RSS feed for the full update.

It's July 26th, 2026, and this is Go.

Today's activity is small but notable: two commits from Jorropo that together fix a real correctness bug in the compiler's handling of MIPS and MIPS64 hardware.

Here's the issue. On these architectures, multiply and divide instructions produce results in two special registers, called HI and LO. The compiler's register allocator was keeping live values homed in those registers. The problem: there's no direct way to spill a value out of HI or LO to memory. The compiler had to…

Commit A-F-4-B-0-2-C fixes this at the root: multiply and divide operations on MIPS now move their results directly into ordinary general-purpose registers as part of the operation itself. Register-to-register moves don't depend on that temporary register, so the dual-use bug can't happen. This closes out issue 80563.

The companion commit, 6-D-B-7-2-B-B, follows up by removing HI and LO support from the register allocator entirely. The commit message is candid about the tradeoff — building a fully correct allocator for these special registers would mean essentially writing a register allocator for the register allocator. Given…

The theme here is maintainability winning over…

Nearby episodes from Go

  1. Security Fixes Across Crypto Stack
  2. Compiler Squeezes Out More Speed at the Instruction Level
  3. Squeezing Cycles Out of the AMD64 Compiler
  4. Weekly Recap - Security Hardening and Compiler Correctness
  5. Cleaning Up the Small Stuff
  6. Correctness Fixes Across Testing, Runtime, and Security
  7. Compiler Correctness Sweep
  8. Shaving Cycles Everywhere