You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The jumpThreading optimization simplifies degenerate if statements, effectively entirely eliminating the one below:
cond = ...
if cond {
} else {
}
leaving only the evaluation of the condition, but not its referrers.
This would be a sound code transformation in a compiler, but because go/ssa strives to stay close to the source code, perhaps it must forego this optimization.
gopherbot
added
the
Tools
This label describes issues relating to any tools in the x/tools repository.
label
Sep 12, 2019
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10.2 linux/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOCACHE="/home/nabice/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/nabice/go:/home/nabice/skygo/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build010669814=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Package: golang.org/x/tools/go/ssa
ok.Referrers do not contains Ifstmt
https://play.golang.org/p/wkERfEjeSu1
I found it is replaced here:
https://github.com/golang/tools/blob/e10d6c9a84802dced65cb0278773be159bb7ed07/go/ssa/blockopt.go#L89
What did you expect to see?
ok.Referrers contain Ifstmt's cond -- "ok"
What did you see instead?
wrong
The text was updated successfully, but these errors were encountered: