spontaneous temp defs need to have their users incremented when an

assignment is part of a sub expression
This commit is contained in:
Bill Currie 2001-12-12 21:29:04 +00:00
parent 7e38a8d9a0
commit 6d65fe853d
2 changed files with 4 additions and 0 deletions

View file

@ -317,6 +317,7 @@ typedef struct def_s {
unsigned removed:1; // already removed from the symbol table
unsigned used:1; // unused local detection
unsigned absolute:1; // don't relocate (for temps for shorts)
unsigned managed:1; // managed temp
string_t file; // source file
int line; // source line

View file

@ -268,6 +268,8 @@ emit_sub_expr (expr_t *e, def_t *dest)
}
if (e->e.expr.op == '=' || e->e.expr.op == PAS) {
d = emit_assign_expr (e->e.expr.op, e);
if (!d->managed)
d->users++;
break;
}
if (e->e.expr.e1->type == ex_block
@ -359,6 +361,7 @@ emit_sub_expr (expr_t *e, def_t *dest)
e->e.temp.def = PR_GetTempDef (e->e.temp.type, pr_scope);
e->e.temp.def->users = e->e.temp.users;
e->e.temp.def->expr = e;
e->e.temp.def->managed = 1;
}
d = e->e.temp.def;
break;