Commit 2ef53aad authored by yb9976's avatar yb9976
Browse files

Constbits: Repeat evaluation of Phi operands, if necessary.

This fixes opt/fehler308.c.
parent 054acdc3
......@@ -307,6 +307,7 @@ result_unknown_X:
if (is_Phi(irn)) {
ir_node *const block = get_nodes_block(irn);
repeatphi:
z = get_mode_null(m);
o = get_mode_all_one(m);
foreach_irn_in(block, i, pred_block) {
......@@ -317,6 +318,17 @@ result_unknown_X:
o = tarval_and(o, b->o);
}
}
/* Computing bitinfo for operand 1 might render operand 0 unstable.
* Thus, evaluate the operands until all of them are stable. */
foreach_irn_in(block, i, pred_block) {
bitinfo *const b_cfg = get_bitinfo_recursive(pred_block);
if (b_cfg->z != f) {
bitinfo *const b = get_bitinfo_direct(get_Phi_pred(irn, i));
if (b->state == BITINFO_UNSTABLE) {
goto repeatphi;
}
}
}
} else {
/* Undefined if any input is undefined. */
foreach_irn_in(irn, i, pred) {
......
Markdown is supported
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