What version of Go are you using (go version)?
$ go version
go version go1.17.1 linux/amd64
Does this issue reproduce with the latest release?
Yes
What did you do?
package main
import "fmt"
type T struct{a, b, c, d float32}
func AddPP_P(x, y *T) *T {
var z T
z.a = x.a + y.a
z.b = x.b + y.b
z.c = x.c + y.c
z.d = x.d + y.d
return &z
}
func main() {
var a, b T
// inlining call to AddPP_P
var c = AddPP_P(&a, &b) // moved to heap: z
fmt.Println(c)
}
What did you expect to see?
no escapes
What did you see instead?
One escape.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes
What did you do?
What did you expect to see?
no escapes
What did you see instead?
One escape.