]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.17] cmd/compile: fix fuse pass to do CFG surgery correctly
authorKeith Randall <khr@golang.org>
Sat, 23 Oct 2021 17:16:41 +0000 (10:16 -0700)
committerHeschi Kreinick <heschi@google.com>
Wed, 24 Nov 2021 19:33:23 +0000 (19:33 +0000)
commit1c05b9b02441f95cce82bed971b7a2204e8bbf6d
treeaea535396ad88f5a682740c4702de1d297c0eb30
parent364f15ff9f1f47c4ec08eb883c0318624592b3b5
[release-branch.go1.17] cmd/compile: fix fuse pass to do CFG surgery correctly

removePred and removeArg do different things. removePred moves the last
predecessor to index k, whereas removeArg slides all the args k or
greater down by 1 index.

Kind of unfortunate different behavior in things named similarly.

Fixes #49129

Change-Id: I9ae409bdac744e713f4c121f948e43db6fdc8542
Reviewed-on: https://go-review.googlesource.com/c/go/+/358117
Trust: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
(cherry picked from commit 8dbf3e9393400d72d313e5616c88873e07692c70)
Reviewed-on: https://go-review.googlesource.com/c/go/+/358118
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/ssa/fuse_branchredirect.go
test/fixedbugs/issue49122.go [new file with mode: 0644]