]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix wrong position when rewriting to OpArg/OpArgXXX
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 26 Aug 2022 05:19:50 +0000 (12:19 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 30 Aug 2022 00:49:19 +0000 (00:49 +0000)
commit629ae1cee673c66dd540b424c9e86a4ce3aaf9e3
tree3e7b694962abaef54e6c170e363f52e3acc27d8a
parent47f8db368cbb1971f386717ae7c76a1891a6130c
cmd/compile: fix wrong position when rewriting to OpArg/OpArgXXX

When spilling arg to stack or register, if it's a newly created value,
the arg position should be preserved. Otherwise, we may end up using
position information from deadcode lines.

This fixes the minimized test case in #54625 by mdempsky@, and make
building std successfully. However, the inline trees for these tests
still be corrupted:

 - fixedbugs/issue53982.go
 - typeparam/issue47775.go
 - typeparam/issue47775b.go
 - typeparam/issue49432.go

We probably still mess up the inline position somewhere else.

Updates #54625

Change-Id: I0d87e26b9ab451b85b6e79787da74a2b79a16209
Reviewed-on: https://go-review.googlesource.com/c/go/+/425785
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/ssa/expand_calls.go