mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-30 08:00:51 +00:00
[qfcc] Force live vars used by function statements
This uses ud-chains for function statements (call/return) to force their arguments to be live (in particular, indirect references via pointers) this fixes the arraylife test.
This commit is contained in:
parent
fb1b3e0869
commit
fe045f75fb
1 changed files with 13 additions and 2 deletions
|
@ -196,7 +196,7 @@ operand_label (dag_t *dag, operand_t *op)
|
||||||
label->op = op;
|
label->op = op;
|
||||||
op->label->daglabel = label;
|
op->label->daglabel = label;
|
||||||
} else {
|
} else {
|
||||||
internal_error (op->expr, "unexpected operand type: %d", op->op_type);
|
internal_error (op->expr, "unexpected operand type: %s", op_type_names[op->op_type]);
|
||||||
}
|
}
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
@ -483,7 +483,18 @@ dagnode_set_edges (dag_t *dag, dagnode_t *n, statement_t *s)
|
||||||
}
|
}
|
||||||
label->live = 1;
|
label->live = 1;
|
||||||
}
|
}
|
||||||
// ensure all operantions on global variables are completed before
|
for (int i = 0; i < s->num_use; i++) {
|
||||||
|
udchain_t ud = func->ud_chains[s->first_use + i];
|
||||||
|
flowvar_t *var = func->vars[ud.var];
|
||||||
|
if (var->op->op_type == op_pseudo) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
daglabel_t *l = operand_label (dag, var->op);
|
||||||
|
if (l) {
|
||||||
|
l->live = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ensure all operations on global variables are completed before
|
||||||
// the st_func statement executes
|
// the st_func statement executes
|
||||||
for (set_iter_t *g = set_first (func->global_vars); g;
|
for (set_iter_t *g = set_first (func->global_vars); g;
|
||||||
g = set_next (g)) {
|
g = set_next (g)) {
|
||||||
|
|
Loading…
Reference in a new issue