diff options
author | David Chase <drchase@google.com> | 2018-05-25 16:08:13 -0400 |
---|---|---|
committer | David Chase <drchase@google.com> | 2018-05-30 16:39:21 +0000 |
commit | 31e1c30f55165785dd12e7c67babedeb950a721d (patch) | |
tree | 55ab705ca77332a378a820df25e08824a625dd1b /src/cmd/compile/internal/ssa/export_test.go | |
parent | d5bc3b96c6fb758561e6274c8f69232623157ca4 (diff) | |
download | go-31e1c30f55165785dd12e7c67babedeb950a721d.tar.gz go-31e1c30f55165785dd12e7c67babedeb950a721d.zip |
cmd/compile: do not allow regalloc to LoadReg G register
On architectures where G is stored in a register, it is
possible for a variable to allocated to it, and subsequently
that variable may be spilled and reloaded, for example
because of an intervening call. If such an allocation
reaches a join point and it is the primary predecessor,
it becomes the target of a reload, which is only usually
right.
Fix: guard all the LoadReg ops, and spill value in the G
register (if any) before merges (in the same way that 387
FP registers are freed between blocks).
Includes test.
Fixes #25504.
Change-Id: I0482a53e20970c7315bf09c0e407ae5bba2fe05d
Reviewed-on: https://go-review.googlesource.com/114695
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/export_test.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/export_test.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/export_test.go b/src/cmd/compile/internal/ssa/export_test.go index be9f19b51c..5832050a8a 100644 --- a/src/cmd/compile/internal/ssa/export_test.go +++ b/src/cmd/compile/internal/ssa/export_test.go @@ -28,6 +28,7 @@ var testCtxts = map[string]*obj.Link{ func testConfig(tb testing.TB) *Conf { return testConfigArch(tb, "amd64") } func testConfigS390X(tb testing.TB) *Conf { return testConfigArch(tb, "s390x") } +func testConfigARM64(tb testing.TB) *Conf { return testConfigArch(tb, "arm64") } func testConfigArch(tb testing.TB, arch string) *Conf { ctxt, ok := testCtxts[arch] |