The Wire · Showcase
RISCV64 COMPILER BUG BREAKS UNSIGNED VALUE HANDLING
By RepoJournal · Filed · About Go
Go's compiler is silently corrupting unsigned integer sign extensions on RISCV64, a critical correctness issue that requires immediate attention across the platform.
The riscv64 lowering rules remove sign extensions after 32-bit instructions, but regalloc restores spilled values with an extension chosen from their type: unsigned 4-byte values are restored zero-extended, losing the sign extension the rules removed [1]. This cascades across multiple fronts. The compiler is also missing opcode coverage in ZeroUpper32Bits, letting redundant zero-extensions slip through on amd64 and arm64 [2]. A separate OpenBSD/RISCV64 breakage from a recent stack check addition needs removal [3]. Beyond core compiler fixes, the release covers quality-of-life improvements: dark mode support for net/http directory listings [4], iOS version parsing that handles three-component versions like 13.1.1 [5], and test infrastructure cleanup across pkgsite [6], [7]. The present tool got two fixes for directive validation and documentation accuracy [8], [9]. 18 commits across 4 repos shipped in this period.
One email a day. Unsubscribe in one click.
Keep up with Go in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Test RISCV64 codegen immediately - unsigned value corruption is a silent data corruption risk golang/go [immediate]
- → If building for OpenBSD/RISCV64, apply the stackcheck removal before next deployment golang/go [immediate]
- → Monitor amd64 and arm64 builds for zero-extension regressions as ZeroUpper32Bits coverage improves golang/go [monitor]
References
- [1] cmd/compile: do not elide riscv64 sign extension of unsigned values golang/go
- [2] cmd/compile/internal/ssa: complete ZeroUpper*Bits opcode coverage golang/go
- [3] runtime: remove stackcheck from openbsd/riscv64 golang/go
- [4] net/http: support dark mode in dir listing golang/go
- [5] cmd/gomobile: support three-component iOS versions golang/mobile
- [6] internal/frontend: doc signal: clean up tests golang/pkgsite
- [7] internal/frontend: doc signal: more test reorg golang/pkgsite
- [8] present: validate background directive arguments golang/tools
- [9] present: correct documented time for dates golang/tools