Use define from temp aliases as well to kill uninit defines.

Finally, the uninitialized temp warnings are fixed.
This commit is contained in:
Bill Currie 2012-12-11 13:04:06 +09:00
parent 5083679fcc
commit 50b0bd0b95

View file

@ -616,6 +616,7 @@ flow_uninit_scan_statements (flownode_t *node, set_t *defs, set_t *uninit)
statement_t *st;
set_iter_t *var_i;
flowvar_t *var;
operand_t *op;
// defs holds only reaching definitions. make it hold only reaching
// uninitialized definitions
@ -643,6 +644,17 @@ flow_uninit_scan_statements (flownode_t *node, set_t *defs, set_t *uninit)
var = node->graph->func->vars[var_i->value];
// kill any reaching uninitialized definitions for this variable
set_difference (defs, var->define);
if (var->op->op_type == op_temp) {
op = var->op;
if (op->o.tempop.alias) {
var = op->o.tempop.alias->o.tempop.flowvar;
set_difference (defs, var->define);
}
for (op = op->o.tempop.alias_ops; op; op = op->next) {
var = op->o.tempop.flowvar;
set_difference (defs, var->define);
}
}
}
}
set_delete (stuse);