cmd/gc: handle variable initialization by block move in liveness
Any initialization of a variable by a block copy or block zeroing
or by multiple assignments (componentwise copying or zeroing
of a multiword variable) needs to emit a VARDEF. These cases were not.
Fixes #7205.
TBR=iant
CC=golang-codereviews
https://golang.org/cl/63650044
diff --git a/test/live.go b/test/live.go
index c3dbc55..ec2df7e 100644
--- a/test/live.go
+++ b/test/live.go
@@ -95,3 +95,21 @@
return
}
+// ignoring block returns used to cause "live at entry to f8: x, y".
+
+func f8() (x, y string) {
+ return g8()
+}
+
+func g8() (string, string)
+
+// ignoring block assignments used to cause "live at entry to f9: x"
+// issue 7205
+
+var i9 interface{}
+
+func f9() bool {
+ g8()
+ x := i9
+ return x != 99
+}