summaryrefslogtreecommitdiffhomepage
path: root/ir/ana
diff options
context:
space:
mode:
authorSebastian Buchwald <Sebastian.Buchwald@kit.edu>2015-11-06 21:58:43 +0100
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>2015-11-06 21:58:43 +0100
commit2ef53aad49064292d8aa4dcf8fa743704b75a2ff (patch)
treecdb7c1fa1b6a82a849ef4587fe18014ca936a397 /ir/ana
parent054acdc3cebaac58a60ac372454b6cef024004fa (diff)
Constbits: Repeat evaluation of Phi operands, if necessary.
This fixes opt/fehler308.c.
Diffstat (limited to 'ir/ana')
-rw-r--r--ir/ana/constbits.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ir/ana/constbits.c b/ir/ana/constbits.c
index a1d8b89..af8db49 100644
--- a/ir/ana/constbits.c
+++ b/ir/ana/constbits.c
@@ -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) {