We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
$ go version go version go1.15.2 darwin/amd64
Yes, since 1.15.2 is the latest stable release.
1.15.2
go env
$ go env GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/Users/xxx/Library/Caches/go-build" GOENV="/Users/xxx/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/path/to/gopath/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/path/to/gopath" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/path/to/gopath/go/src/github.com/anqurvanillapy/xxx/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/ht/0xdbpqwx5236z5p7q9y7s2wm0000gn/T/go-build530521061=/tmp/go-build -gno-record-gcc-switches -fno-common"
Try to dump SSAs from a simple hello-world script.
package main import ( "fmt" ) func main() { fmt.Println("Hello, Go compiler!") }
$ env GOSSAFUNC=main go build main.go
The ssa.html is generated in the same directory.
ssa.html
$ env GOSSAFUNC=main go build main.go # runtime panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x4 pc=0x1270567] goroutine 7 [running]: cmd/compile/internal/ssa.(*Func).Fatalf(...) /usr/local/go/src/cmd/compile/internal/ssa/func.go:625 cmd/compile/internal/ssa.NewHTMLWriter(0x1843bff, 0x8, 0xc00577e420, 0x0, 0x0, 0x1) /usr/local/go/src/cmd/compile/internal/ssa/html.go:33 +0xe7 cmd/compile/internal/gc.buildssa(0xc001954840, 0x1, 0x0) /usr/local/go/src/cmd/compile/internal/gc/ssa.go:342 +0x1172 cmd/compile/internal/gc.compileSSA(0xc001954840, 0x1) /usr/local/go/src/cmd/compile/internal/gc/pgen.go:317 +0x5d cmd/compile/internal/gc.compileFunctions.func2(0xc00447cc00, 0xc000b91c90, 0x1) /usr/local/go/src/cmd/compile/internal/gc/pgen.go:382 +0x4d created by cmd/compile/internal/gc.compileFunctions /usr/local/go/src/cmd/compile/internal/gc/pgen.go:380 +0x129
The text was updated successfully, but these errors were encountered:
Duplicate of #40919
Sorry, something went wrong.
Thanks for your reply! Close due to duplication.
Until the release of 1.16, avoid name collisions with stdlib for the target function, e.g.
package main import ( "fmt" ) func hello() { fmt.Println("Hello, Go compiler!") } func main() { hello() }
Then
$ env GOSSAFUNC=hello go build main.go # command-line-arguments dumped SSA to ./ssa.html
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, since
1.15.2
is the latest stable release.What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Try to dump SSAs from a simple hello-world script.
What did you expect to see?
The
ssa.html
is generated in the same directory.What did you see instead?
The text was updated successfully, but these errors were encountered: