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
{{ message }}
Repository navigation
cmd/compile: GOEXPERIMENT=clobberdead is broken #27326
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
darwin/amd64
What did you do?
$ GOEXPERIMENT=clobberdead ./all.bash
Building Go cmd/dist using /Users/cherryyz/src/go1.8.
Building Go toolchain1 using /Users/cherryyz/src/go1.8.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
go tool dist: FAILED: /Users/cherryyz/src/go-tip/pkg/tool/darwin_amd64/go_bootstrap install -gcflags=all= -ldflags=all= -i cmd/asm cmd/cgo cmd/compile cmd/link: exit status 2
Not sure if it catches a real bug, or the experiment itself is broken. I may take a look tomorrow.
The main thing is that we now have many more safepoints, at nearly all instructions. Clobbering at all these safepoints currently doesn't work. Maybe the stack maps at non-call safepoints are still imprecise, or some other reason. I haven't investigated. CL 131956 disables non-call safepoints for clobbering.
With the two CLs above, I got it mostly working on Linux AMD64. There are a few tests failing, that are incompatible with the experiment, for example, explicitly testing register maps. And when bootstrapping cmd/go complains about some packages are stall, which I have no idea how to debug, so I just skipped the check (by setting a VERSION). Besides those, it works fine.
On Darwin AMD64, it still doesn't work. Still looking.
Now that we have stack objects, there's the additional complication that we can't clobber stack objects (all address-taken local variables) because plive doesn't know for sure that they are dead anymore.
clobberdead was originally intended to test all the weird ambiguously live logic. Maybe now that all that logic is gone, we can retire this mode.
Activity
gopherbot commentedon Aug 29, 2018
Change https://golang.org/cl/131956 mentions this issue:
cmd/compile: only clobber dead slots at call sitesgopherbot commentedon Aug 29, 2018
Change https://golang.org/cl/131957 mentions this issue:
cmd/compile: don't clobber dead slots in runtime.wbBufFlushcherrymui commentedon Aug 29, 2018
The main thing is that we now have many more safepoints, at nearly all instructions. Clobbering at all these safepoints currently doesn't work. Maybe the stack maps at non-call safepoints are still imprecise, or some other reason. I haven't investigated. CL 131956 disables non-call safepoints for clobbering.
With the two CLs above, I got it mostly working on Linux AMD64. There are a few tests failing, that are incompatible with the experiment, for example, explicitly testing register maps. And when bootstrapping cmd/go complains about some packages are stall, which I have no idea how to debug, so I just skipped the check (by setting a VERSION). Besides those, it works fine.
On Darwin AMD64, it still doesn't work. Still looking.
cmd/compile: only clobber dead slots at call sites
cmd/compile: don't clobber dead slots in runtime.wbBufFlush
randall77 commentedon Oct 30, 2018
Now that we have stack objects, there's the additional complication that we can't clobber stack objects (all address-taken local variables) because plive doesn't know for sure that they are dead anymore.
clobberdeadwas originally intended to test all the weird ambiguously live logic. Maybe now that all that logic is gone, we can retire this mode.gopherbot commentedon Nov 26, 2018
Change https://golang.org/cl/151317 mentions this issue:
cmd/compile: remove CLOBBERDEAD experiment