]> Cypherpunks repositories - gostls13.git/commit
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)
committerKeith Randall <khr@golang.org>
Sat, 23 Oct 2021 20:23:35 +0000 (20:23 +0000)
commit8dbf3e9393400d72d313e5616c88873e07692c70
tree87f13d22358538112a848a97f45a9c5b7a6b76b7
parent16318df4a225928c2f24874f6fcd11c3e13a112e
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 #49122

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>
src/cmd/compile/internal/ssa/fuse_branchredirect.go
test/fixedbugs/issue49122.go [new file with mode: 0644]