Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/vet: false positive for MOVOU #54869

Open
zhangyunhao116 opened this issue Sep 5, 2022 · 3 comments
Open

cmd/vet: false positive for MOVOU #54869

zhangyunhao116 opened this issue Sep 5, 2022 · 3 comments
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.
Milestone

Comments

@zhangyunhao116
Copy link
Contributor

zhangyunhao116 commented Sep 5, 2022

What version of Go are you using (go version)?

$ go version (latest)
go version devel go1.20-e8894bd8fc Mon Sep 5 11:30:31 2022 +0800 linux/amd64

Does this issue reproduce with the latest release?

YES

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
Not related.

What did you do?

$ go vet

#include "textflag.h"

// func foo() [2]uint64
TEXT ·foo(SB),NOSPLIT,$0-16
    MOVOU X1, ret+0(FP)
    RET

What did you expect to see?

Nothing happens.

What did you see instead?

./x.s:5:1: [amd64] foo: invalid MOVOU of ret+0(FP); [2]uint64 is 16-byte value

The size of MOVOU is 16 bytes (https://www.felixcloutier.com/x86/movdqu:vmovdqu8:vmovdqu16:vmovdqu32:vmovdqu64), it is the same as the [2]uint64.
So I guess it may be a false positive?
asmdecl code: https://github.com/golang/tools/blob/master/go/analysis/passes/asmdecl/asmdecl.go#L822

@randall77
Copy link
Contributor

Hmm, I would have expected this to be fixed with https://go-review.googlesource.com/c/tools/+/204537/ . At least, if we replace [2]uint64 with [2]float64 (which also reports an error).

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 6, 2022
@mknyszek
Copy link
Contributor

mknyszek commented Sep 6, 2022

CC @golang/tools-team ?

@mknyszek mknyszek added this to the Go1.20 milestone Sep 6, 2022
@findleyr
Copy link
Contributor

findleyr commented Sep 6, 2022

CC @adonovan

@gopherbot gopherbot modified the milestones: Go1.20, Go1.21 Feb 1, 2023
@adonovan adonovan added the Analysis Issues related to static analysis (vet, x/tools/go/analysis) label Apr 23, 2023
@gopherbot gopherbot modified the milestones: Go1.21, Go1.22 Aug 8, 2023
@gopherbot gopherbot modified the milestones: Go1.22, Go1.23 Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

6 participants