cmd/vet: asmdecl parameter checking doesn't play well with arm64 LDP #57451
Labels
Analysis
Issues related to static analysis (vet, x/tools/go/analysis)
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Unfortunate
Milestone
What version of Go are you using (
go version
)?Go 1.19
Does this issue reproduce with the latest release?
Yes, and also with tip.
And also with the latest x/tools repo (the home of the vet code).
What operating system and processor architecture are you using (
go env
)?I'm on linux/amd64, but I'm looking at arm64-specific checks (I'm running vet
with GOARCH=arm64).
What did you do?
Run
GOARCH=arm64 go vet .
on a package with some code like this:Note the LDP instruction is a handy way on arm64 to load two registers at once. It's a pretty natural way to load the base pointer and length of a slice.
What did you expect to see?
No complaints.
What did you see instead?
That is, vet expects that any reference to offset 0 is named
b_base
, but in this case the reference is actually 16 bytes long; it's bothbase
andlen
.I skimmed the asmdecl code but it's unfortunately not trivial to fix (there seems to be a pretty deeply-baked assumption that a reference to an FP offset corresponds to a single "var").
/cc @matloob and @timothy-king (owners of cmd/vet and x/tools/go/analysis)
The text was updated successfully, but these errors were encountered: