mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.ssa] cmd/compile: don't flush a value derived from the current value
If flushing a value from a register that might be used by the current old-schedule value, save it to the home location. This resolves the error that was changed from panic to unimplemented in CL 12655. Change-Id: If864be34abcd6e11d6117a061376e048a3e29b3a Reviewed-on: https://go-review.googlesource.com/12682 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
b61f8c8df3
commit
c9a38ce758
2 changed files with 22 additions and 2 deletions
|
|
@ -238,7 +238,7 @@ func regalloc(f *Func) {
|
|||
if regs[r].v != nil {
|
||||
x := regs[r].v
|
||||
c := regs[r].c
|
||||
if regs[r].dirty && lastUse[x.ID] > idx {
|
||||
if regs[r].dirty && lastUse[x.ID] >= idx {
|
||||
// Write x back to home. Its value is currently held in c.
|
||||
x.Op = OpStoreReg
|
||||
x.Aux = nil
|
||||
|
|
@ -317,7 +317,7 @@ func regalloc(f *Func) {
|
|||
if regs[r].v != nil {
|
||||
x := regs[r].v
|
||||
c := regs[r].c
|
||||
if regs[r].dirty && lastUse[x.ID] > idx {
|
||||
if regs[r].dirty && lastUse[x.ID] >= idx {
|
||||
// Write x back to home. Its value is currently held in c.
|
||||
x.Op = OpStoreReg
|
||||
x.Aux = nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue