]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.14] cmd/compile: fix deallocation of live value copies in regalloc
authorMichael Munday <mike.munday@ibm.com>
Tue, 14 Apr 2020 14:46:26 +0000 (15:46 +0100)
committerAndrew Bonventre <andybons@golang.org>
Tue, 28 Apr 2020 16:28:26 +0000 (16:28 +0000)
commitc4b92691b021dbed5ab243ced91c030286dcb922
tree33377f644aec44091b6847be69f22f3d5a203dcb
parentcd65852feeef2e6e8d8c06bbf037bc4d6372e93d
[release-branch.go1.14] cmd/compile: fix deallocation of live value copies in regalloc

When deallocating the input register to a phi so that the phi
itself could be allocated to that register the code was also
deallocating all copies of that phi input value. Those copies
of the value could still be live and if they were the register
allocator could reuse them incorrectly to hold speculative
copies of other phi inputs. This causes strange bugs.

No test because this is a very obscure scenario that is hard
to replicate but CL 228060 adds an assertion to the compiler
that does trigger when running the std tests on linux/s390x
without this CL applied. Hopefully that assertion will prevent
future regressions.

Fixes #38443.

Change-Id: Id975dadedd731c7bb21933b9ea6b17daaa5c9e1d
Reviewed-on: https://go-review.googlesource.com/c/go/+/228061
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
(cherry picked from commit 382fe3e2498f2066400e7e7007aa9903440e339d)
Reviewed-on: https://go-review.googlesource.com/c/go/+/230357
src/cmd/compile/internal/ssa/regalloc.go