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/asm: generates invalid MULX instruction #58735

Closed
armfazh opened this issue Feb 26, 2023 · 2 comments
Closed

cmd/asm: generates invalid MULX instruction #58735

armfazh opened this issue Feb 26, 2023 · 2 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@armfazh
Copy link

armfazh commented Feb 26, 2023

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

$ go version
go version go1.20.1 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
GO111MODULE=""

GOARCH="amd64"

GOBIN=""

GOCACHE="/home/user/.cache/go-build"

GOENV="/home/user/.config/go/env"

GOEXE=""

GOEXPERIMENT=""

GOFLAGS=""

GOHOSTARCH="amd64"

GOHOSTOS="linux"

GOINSECURE=""

GOMODCACHE="/home/user/go/pkg/mod"

GONOPROXY=""

GONOSUMDB=""

GOOS="linux"

GOPATH="/home/user/go"

GOPRIVATE=""

GOPROXY="https://proxy.golang.org,direct"

GOROOT="/usr/local/go"

GOSUMDB="sum.golang.org"

GOTMPDIR=""

GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"

GOVCS=""

GOVERSION="go1.20.1"

GCCGO="gccgo"

GOAMD64="v1"

AR="ar"

CC="gcc"

CXX="g++"
CGO_ENABLED="1"
GOMOD=""
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1448370878=/tmp/go-build -gno-record-gcc-switches"

What did you do?

main.go

package main

var myGlobal = [2]uint64{0,0}

//go:noescape
func a1()

func main() {
    _ = myGlobal
    a1()
}

mulx_amd64.s

TEXT ·a1(SB),0,$0-0
    MULXQ ·myGlobal(SB), AX, CX
    RET

Command:

$ go mod init example.com/mulx
$ go build -buildmode=plugin

What did you expect to see?

Command compiles this program succesfully.

What did you see instead?

# example.com/mulx
asm: "".a1: invalid instruction: 00007 (/home/user/mulx_amd64.s:2)	MULXQ	(R15), CX
asm: assembly failed
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Feb 26, 2023
@thanm thanm added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 27, 2023
@thanm
Copy link
Contributor

thanm commented Feb 27, 2023

@golang/compiler

@randall77 randall77 self-assigned this Feb 27, 2023
@gopherbot
Copy link

Change https://go.dev/cl/471675 mentions this issue: cmd/asm: preserve 3rd arg when GOT-rewriting assembly instructions

@randall77 randall77 added this to the Go1.21 milestone Feb 27, 2023
@golang golang locked and limited conversation to collaborators Feb 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge 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

4 participants