[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:
Josh Bleecher Snyder 2015-07-24 14:51:51 -07:00
parent db5232620a
commit 0bb2a50a55
4 changed files with 31 additions and 16 deletions

View file

@ -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, &registers[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)