mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.ssa] cmd/compile: respect stack slot width when storing/loading registers
Prior to this, we were smashing our own stack, which caused the crypto/sha256 tests to fail. Change-Id: I7dd94cf466d175b3be0cd65f9c4fe8b1223081fe Reviewed-on: https://go-review.googlesource.com/12660 Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
db5232620a
commit
0bb2a50a55
4 changed files with 31 additions and 16 deletions
|
|
@ -240,7 +240,7 @@ func regalloc(f *Func) {
|
|||
c := regs[r].c
|
||||
if regs[r].dirty && lastUse[x.ID] > idx {
|
||||
// Write x back to home. Its value is currently held in c.
|
||||
x.Op = OpStoreReg8
|
||||
x.Op = OpStoreReg
|
||||
x.Aux = nil
|
||||
x.resetArgs()
|
||||
x.AddArg(c)
|
||||
|
|
@ -276,7 +276,7 @@ func regalloc(f *Func) {
|
|||
c = b.NewValue1(w.Line, OpCopy, w.Type, regs[s].c)
|
||||
} else {
|
||||
// Load from home location
|
||||
c = b.NewValue1(w.Line, OpLoadReg8, w.Type, w)
|
||||
c = b.NewValue1(w.Line, OpLoadReg, w.Type, w)
|
||||
}
|
||||
home = setloc(home, c, ®isters[r])
|
||||
// Remember what we did
|
||||
|
|
@ -319,7 +319,7 @@ func regalloc(f *Func) {
|
|||
c := regs[r].c
|
||||
if regs[r].dirty && lastUse[x.ID] > idx {
|
||||
// Write x back to home. Its value is currently held in c.
|
||||
x.Op = OpStoreReg8
|
||||
x.Op = OpStoreReg
|
||||
x.Aux = nil
|
||||
x.resetArgs()
|
||||
x.AddArg(c)
|
||||
|
|
@ -373,7 +373,7 @@ func regalloc(f *Func) {
|
|||
}
|
||||
|
||||
// change v to be a copy of c
|
||||
v.Op = OpStoreReg8
|
||||
v.Op = OpStoreReg
|
||||
v.Aux = nil
|
||||
v.resetArgs()
|
||||
v.AddArg(c)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue