Commit c279966c authored by Christian Würdig's avatar Christian Würdig
Browse files

fixed flags

parent 323267da
......@@ -265,17 +265,19 @@ static arch_irn_class_t ia32_classify(const void *self, const ir_node *irn) {
}
static arch_irn_flags_t ia32_get_flags(const void *self, const ir_node *irn) {
arch_irn_flags_t flags = arch_irn_flags_none;
arch_irn_flags_t flags;
ir_node *pred = is_Proj(irn) ? get_Proj_pred(irn) : NULL;
if (is_Proj(irn) && is_ia32_irn(get_Proj_pred(irn))) {
flags |= get_ia32_out_flags(irn, get_Proj_proj(irn));
}
irn = skip_Proj(irn);
if (is_ia32_irn(irn))
flags |= get_ia32_flags(irn);
else if (is_Unknown(irn))
if (is_Unknown(irn))
flags = arch_irn_flags_ignore;
else {
/* pred is only set, if we have a Proj */
flags = pred && is_ia32_irn(pred) ? get_ia32_out_flags(pred, get_Proj_proj(irn)) : arch_irn_flags_none;
irn = skip_Proj(irn);
if (is_ia32_irn(irn))
flags |= get_ia32_flags(irn);
}
return flags;
}
......
......@@ -1089,8 +1089,7 @@ void set_ia32_out_flags(ir_node *node, arch_irn_flags_t flags, int pos) {
*/
arch_irn_flags_t get_ia32_out_flags(const ir_node *node, int pos) {
ia32_attr_t *attr = get_ia32_attr(node);
assert(pos < (int) attr->data.n_res && "Invalid OUT position.");
return attr->out_flags[pos];
return pos < (int)attr->data.n_res ? attr->out_flags[pos] : arch_irn_flags_none;
}
#ifndef NDEBUG
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment