Set def after setting use.

An instruction that both reads and writes the same variable will read the
variable before writing to it, so the instruction uses the variable rather
than defines it (for live-variable purposes).
This commit is contained in:
Bill Currie 2012-11-06 18:29:09 +09:00
parent 58cb73d6aa
commit e3a49df0a8

View file

@ -287,9 +287,9 @@ flow_live_vars (flowgraph_t *graph)
def = set_new ();
for (st = node->sblock->statements; st; st = st->next) {
find_operands (st, &d, &u[0], &u[1], &u[2]);
live_set_def (flow_get_var (d), use, def);
for (j = 0; j < 3; j++)
live_set_use (flow_get_var (u[j]), use, def);
live_set_def (flow_get_var (d), use, def);
}
node->live_vars.use = use;
node->live_vars.def = def;