mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: fix build
Run live vars test only on ssa builds. We can't just drop KeepAlive ops during regalloc. We need to replace them with copies. Change-Id: Ib4b3b1381415db88fdc2165fc0a9541b73ad9759 Reviewed-on: https://go-review.googlesource.com/23225 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
6ab45c09f6
commit
075880a8e8
2 changed files with 4 additions and 2 deletions
|
|
@ -948,13 +948,14 @@ func (s *regAllocState) regalloc(f *Func) {
|
||||||
if vi.spillUsed {
|
if vi.spillUsed {
|
||||||
// Use the spill location.
|
// Use the spill location.
|
||||||
v.SetArg(0, vi.spill)
|
v.SetArg(0, vi.spill)
|
||||||
b.Values = append(b.Values, v)
|
|
||||||
} else {
|
} else {
|
||||||
// No need to keep unspilled values live.
|
// No need to keep unspilled values live.
|
||||||
// These are typically rematerializeable constants like nil,
|
// These are typically rematerializeable constants like nil,
|
||||||
// or values of a variable that were modified since the last call.
|
// or values of a variable that were modified since the last call.
|
||||||
v.Args[0].Uses--
|
v.Op = OpCopy
|
||||||
|
v.SetArgs1(v.Args[1])
|
||||||
}
|
}
|
||||||
|
b.Values = append(b.Values, v)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
regspec := opcodeTable[v.Op].reg
|
regspec := opcodeTable[v.Op].reg
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
// Copyright 2016 The Go Authors. All rights reserved.
|
// Copyright 2016 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
// +build amd64
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue