You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/compile: dev.typeparams commit 0a0e3a3 broke dev.boringcrypto; fixed again at a72a499 #47227
Merging 0a0e3a3 into dev.boringcrypto causes make.bash to fail due to:
Building Go toolchain2 using go_bootstrap and Go toolchain1.
# crypto/internal/boring
<autogenerated>:1: internal compiler error: offset for r1 at $WORK/b060/_cgo_gotypes.go:842:75 changed from 8 to 0
This build failure was fixed a few commits later at a72a499.
That later commit was just an optimization, so it shouldn't be essential to correctly handling compiling this code. It would be good to get a minimal, standalone reproducer for what failed and add it as a compiler regress test.
@mdempsky@cherrymui So the problem is not related to 0a0e3a3 and a72a499. This failed to compile even with current dev.typeparams tip:
$ cat _cgo_gotypes.go
package p
//go:cgo_unsafe_args
func g(*int) (r1 struct{}) {
return
}
func f() {
x := g
defer x(new(int))
}
The problem is that ssagen/ssa.go:state.call does't handle direct function value, so it use the wrong ABI to set the offset, which causes offset changed.
Activity
cuonglm commentedon Jul 16, 2021
I haven't looked deeper, but here's a simple reproducer:
Just checkout commit 0a0e3a3 on dev.typeparams.
gopherbot commentedon Jul 16, 2021
Change https://golang.org/cl/334882 mentions this issue:
[dev.typeparams] test: add regression test for go/defer wrappergopherbot commentedon Jul 17, 2021
Change https://golang.org/cl/334883 mentions this issue:
[dev.typeparams] cmd/compile: make ssagen analyze ABI correctly for static function valuecuonglm commentedon Jul 17, 2021
@mdempsky @cherrymui So the problem is not related to 0a0e3a3 and a72a499. This failed to compile even with current dev.typeparams tip:
The problem is that ssagen/ssa.go:state.call does't handle direct function value, so it use the wrong ABI to set the offset, which causes offset changed.
[dev.typeparams] test: add regression test for go/defer wrapper
gopherbot commentedon Jul 22, 2021
Change https://golang.org/cl/336629 mentions this issue:
cmd/compile: do not change field offset in ABI analysisgopherbot commentedon Jul 22, 2021
Change https://golang.org/cl/336610 mentions this issue:
[dev.typeparams] cmd/compile: remove outdate TODO in escape analysis[dev.typeparams] cmd/compile: remove outdate TODO in escape analysis
cmd/compile: do not change field offset in ABI analysis