Skip to content

Commit 0b26678

Browse files
randall77gopherbot
authored andcommitted
cmd/compile: fix mips zerorange implementation
A +8 was missed when simplifying this code in CL 700936. Fixes #75477 Change-Id: Ic7b83322dc1373432b44f0b63607141195220380 Reviewed-on: https://go-review.googlesource.com/c/go/+/703937 Reviewed-by: Keith Randall <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Julian Zhu <[email protected]> Auto-Submit: Keith Randall <[email protected]> Reviewed-by: Tianon Gravi <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent e2cfc1e commit 0b26678

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/cmd/compile/internal/mips/ggen.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package mips
66

77
import (
8+
"cmd/compile/internal/base"
89
"cmd/compile/internal/objw"
910
"cmd/compile/internal/types"
1011
"cmd/internal/obj"
@@ -17,7 +18,7 @@ func zerorange(pp *objw.Progs, p *obj.Prog, off, cnt int64, _ *uint32) *obj.Prog
1718
}
1819

1920
for cnt != 0 {
20-
p = pp.Append(p, mips.AMOVW, obj.TYPE_REG, mips.REGZERO, 0, obj.TYPE_MEM, mips.REGSP, off)
21+
p = pp.Append(p, mips.AMOVW, obj.TYPE_REG, mips.REGZERO, 0, obj.TYPE_MEM, mips.REGSP, base.Ctxt.Arch.FixedFrameSize+off)
2122
cnt -= int64(types.PtrSize)
2223
off += int64(types.PtrSize)
2324
}

src/cmd/compile/internal/mips64/ggen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func zerorange(pp *objw.Progs, p *obj.Prog, off, cnt int64, _ *uint32) *obj.Prog
1717
}
1818

1919
for cnt != 0 {
20-
p = pp.Append(p, mips.AMOVV, obj.TYPE_REG, mips.REGZERO, 0, obj.TYPE_MEM, mips.REGSP, off)
20+
p = pp.Append(p, mips.AMOVV, obj.TYPE_REG, mips.REGZERO, 0, obj.TYPE_MEM, mips.REGSP, off+8)
2121
cnt -= int64(types.PtrSize)
2222
off += int64(types.PtrSize)
2323
}

0 commit comments

Comments
 (0)