int32 c, odst, osrc;
int dir, align, op;
Prog *p, *ploop;
+ NodeList *l;
if(debug['g']) {
print("\nsgen w=%lld\n", w);
return;
}
+ // Record site of definition of ns for liveness analysis.
+ if(res->op == ONAME && res->class != PEXTERN)
+ gvardef(res);
+
+ // If copying .args, that's all the results, so record definition sites
+ // for them for the liveness analysis.
+ if(res->op == ONAME && strcmp(res->sym->name, ".args") == 0)
+ for(l = curfn->dcl; l != nil; l = l->next)
+ if(l->n->class == PPARAMOUT)
+ gvardef(l->n);
+
// Avoid taking the address for simple enough types.
if(componentgen(n, res))
return;
{
Node nodl, nodr, nodsi, noddi, cx, oldcx, tmp;
vlong c, q, odst, osrc;
+ NodeList *l;
if(debug['g']) {
print("\nsgen w=%lld\n", w);
if(w < 0)
fatal("sgen copy %lld", w);
+
+ // Record site of definition of ns for liveness analysis.
+ if(ns->op == ONAME && ns->class != PEXTERN)
+ gvardef(ns);
+
+ // If copying .args, that's all the results, so record definition sites
+ // for them for the liveness analysis.
+ if(ns->op == ONAME && strcmp(ns->sym->name, ".args") == 0)
+ for(l = curfn->dcl; l != nil; l = l->next)
+ if(l->n->class == PPARAMOUT)
+ gvardef(l->n);
// Avoid taking the address for simple enough types.
if(componentgen(n, ns))
{
Node dst, src, tdst, tsrc;
int32 c, q, odst, osrc;
+ NodeList *l;
if(debug['g']) {
print("\nsgen w=%lld\n", w);
return;
}
+ // Record site of definition of ns for liveness analysis.
+ if(res->op == ONAME && res->class != PEXTERN)
+ gvardef(res);
+
+ // If copying .args, that's all the results, so record definition sites
+ // for them for the liveness analysis.
+ if(res->op == ONAME && strcmp(res->sym->name, ".args") == 0)
+ for(l = curfn->dcl; l != nil; l = l->next)
+ if(l->n->class == PPARAMOUT)
+ gvardef(l->n);
+
// Avoid taking the address for simple enough types.
if(componentgen(n, res))
return;
void
gvardef(Node *n)
{
- if(n == N || !isfat(n->type))
- fatal("gvardef: node is not fat");
+ if(n == N)
+ fatal("gvardef nil");
switch(n->class) {
case PAUTO:
case PPARAM:
static int
isfunny(Node *node)
{
- char *names[] = { ".fp", ".args", "_", nil };
+ char *names[] = { ".fp", ".args", nil };
int i;
if(node->sym != nil && node->sym->name != nil)
}
if(info.flags & (LeftRead | LeftWrite | LeftAddr)) {
from = &prog->from;
- if (from->node != nil && !isfunny(from->node) && from->sym != nil) {
- switch(prog->from.node->class & ~PHEAP) {
+ if (from->node != nil && from->sym != nil) {
+ switch(from->node->class & ~PHEAP) {
case PAUTO:
case PPARAM:
case PPARAMOUT:
if(info.flags & (LeftRead | LeftAddr))
bvset(uevar, pos);
if(info.flags & LeftWrite)
- if(from->node != nil && (!isfat(from->node->type) || prog->as == AVARDEF))
+ if(from->node != nil && !isfat(from->node->type))
bvset(varkill, pos);
}
}
Next:
if(info.flags & (RightRead | RightWrite | RightAddr)) {
to = &prog->to;
- if (to->node != nil && to->sym != nil && !isfunny(to->node)) {
- switch(prog->to.node->class & ~PHEAP) {
+ if (to->node != nil && to->sym != nil) {
+ switch(to->node->class & ~PHEAP) {
case PAUTO:
case PPARAM:
case PPARAMOUT:
if(pos == -1)
goto Next1;
if(to->node->addrtaken) {
- //if(prog->as == AKILL)
- // bvset(varkill, pos);
- //else
- bvset(avarinit, pos);
+ bvset(avarinit, pos);
+ if(prog->as == AVARDEF)
+ bvset(varkill, pos);
} else {
if(info.flags & (RightRead | RightAddr))
bvset(uevar, pos);
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
+}