Was spuriously marking results live on entry to function.
TBR=iant
CC=golang-codereviews
https://golang.org/cl/
63640043
node = *(Node**)arrayget(vars, i);
switch(node->class & ~PHEAP) {
case PPARAM:
- case PPARAMOUT:
bvset(uevar, i);
+ case PPARAMOUT:
+ // If the result had its address taken, it is being tracked
+ // by the avarinit code, which does not use uevar.
+ // If we added it to uevar too, we'd not see any kill
+ // and decide that the varible was live entry, which it is not.
+ // So only use uevar in the non-addrtaken case.
+ if(!node->addrtaken)
+ bvset(uevar, i);
break;
}
}
y = "hello"
return
}
+
+// confusion about addressed results used to cause "live at entry to f7: x".
+
+func f7() (x string) {
+ _ = &x
+ x = "hello"
+ return
+}
+