Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: GOEXPERIMENT=clobberdead is broken #27326
What version of Go are you using (
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.
We now have safepoints at nearly all the instructions. When GOEXPERIMENT=clobberdead is on, it inserts clobbers nearly at every instruction. Currently this doesn't work. (Maybe the stack maps at non-call safepoints are still imprecise. I haven't investigated.) For now, only use call-based safepoints if the experiment is on. Updates #27326. Change-Id: I72cda9b422d9637cc5738e681502035af7a5c02d Reviewed-on: https://go-review.googlesource.com/131956 Reviewed-by: Keith Randall <firstname.lastname@example.org>
runtime.wbBufFlush must not modify its arguments, because the argument slots are also used as spill slots in runtime.gcWriteBarrier. So, GOEXPERIMENT=clobberdead must not clobber them. Updates #27326. Change-Id: Id02bb22a45201eecee748d89e7bdb3df7e4940e4 Reviewed-on: https://go-review.googlesource.com/131957 Reviewed-by: Keith Randall <email@example.com>
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.