summaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/gsubr.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2020-08-28 17:10:32 +0000
committerKeith Randall <khr@golang.org>2020-08-31 17:36:08 +0000
commit9e70564f639252aade60369b51a121f3325e9d6c (patch)
tree61ada3ce0f0d3bed08f9f1014bd271ea980df516 /src/cmd/compile/internal/gc/gsubr.go
parentba0fab3cb731fe9a383bd61c3480cccfe32bb1f4 (diff)
downloadgo-git-9e70564f639252aade60369b51a121f3325e9d6c.tar.gz
cmd/compile,cmd/asm: simplify recording of branch targets, take 2
We currently use two fields to store the targets of branches. Some phases use p.To.Val, some use p.Pcond. Rewrite so that every branch instruction uses p.To.Val. p.From.Val is also used in rare instances. Introduce a Pool link for use by arm/arm64, instead of repurposing Pcond. This is a cleanup CL in preparation for some stack frame CLs. Change-Id: If8239177e4b1ea2bccd0608eb39553d23210d405 Reviewed-on: https://go-review.googlesource.com/c/go/+/251437 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/gc/gsubr.go')
-rw-r--r--src/cmd/compile/internal/gc/gsubr.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/gc/gsubr.go b/src/cmd/compile/internal/gc/gsubr.go
index 15a84a8a43..480d411f49 100644
--- a/src/cmd/compile/internal/gc/gsubr.go
+++ b/src/cmd/compile/internal/gc/gsubr.go
@@ -342,6 +342,6 @@ func Patch(p *obj.Prog, to *obj.Prog) {
if p.To.Type != obj.TYPE_BRANCH {
Fatalf("patch: not a branch")
}
- p.To.Val = to
+ p.To.SetTarget(to)
p.To.Offset = to.Pc
}