Skip to content

cmd/vet: false positive for MOVOU #54869

@zhangyunhao116

Description

@zhangyunhao116

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    AnalysisIssues related to static analysis (vet, x/tools/go/analysis)NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions