Help us shape the future of Go! Take the 2026 Go Developer Survey

truncspill

command
v0.69.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Command truncspill reports where Go 1.27's loong64 back end spills a float-to-integer conversion in a way that can reach the stack slots next to it -- the shape of golang.org/issue/81000.

On loong64 the rule

(Cvt64Fto32 x) => (TRUNCDW x)

leaves an INTEGER result in a floating-point register, because TRUNCDW is declared `reg: fp11`. Spilling such a value therefore emits an 8-byte MOVD. CL 820040 fixes it by wrapping the conversions in MOVWfpgp/MOVVfpgp, so a toolchain whose output contains no MOV[WV]fpgp does not carry the fix.

An occurrence is NOT a defect. An 8-byte store into its own 8-aligned 8-byte slot writes exactly its own value. It corrupts only when a live neighbour sits inside those eight bytes, which shows as a positive stride below 8 between two spill offsets in one frame, or as an offset that is not 8-aligned. That distinction is the whole point of this command: measured on go-gfx/gfx `./color`, go1.26.4 -- which PASSES on loong64 -- also spills, twice, onto -88 and -96; go1.27.1 -- which FAILS -- spills onto -145..-140 and -275,-276.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL