mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: remove stale register use array
The reg[] array in .../gc is where truth lies. The copy in .../ARCH is incorrect as it is mostly not updated to reflect regalloc decisions. This bug was introduced in the rewrite https://go-review.googlesource.com/#/c/7853/. The new reg[] array was introduced in .../gc but not all of the uses were removed in the .../ARCH directories. Fixes #12133 Change-Id: I6364fc403cdab92d802d17f2913ba1607734037c Reviewed-on: https://go-review.googlesource.com/13630 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
cda1fc0071
commit
e97ab0a0ac
8 changed files with 42 additions and 15 deletions
|
|
@ -602,6 +602,13 @@ func unpatch(p *obj.Prog) *obj.Prog {
|
|||
var reg [100]int // count of references to reg
|
||||
var regstk [100][]byte // allocation sites, when -v is given
|
||||
|
||||
func GetReg(r int) int {
|
||||
return reg[r-Thearch.REGMIN]
|
||||
}
|
||||
func SetReg(r, v int) {
|
||||
reg[r-Thearch.REGMIN] = v
|
||||
}
|
||||
|
||||
func ginit() {
|
||||
for r := range reg {
|
||||
reg[r] = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue