bugfix: the Op(Phi,Phi) optimization require both Phis in the same block
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 25 Oct 2007 16:25:54 +0000 (16:25 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 25 Oct 2007 16:25:54 +0000 (16:25 +0000)
[r16349]

ir/ir/iropt.c

index d12ed01..f0dae40 100644 (file)
@@ -1771,8 +1771,12 @@ static ir_node *apply_binop_on_2_phis(ir_node *a, ir_node *b, tarval *(*eval)(ta
        void     **res;
        ir_node  *pred;
        ir_graph *irg;
-       int      i, n = get_irn_arity(a);
+       int      i, n;
 
+       if (get_nodes_block(a) != get_nodes_block(b))
+      return NULL;
+
+       n = get_irn_arity(a);
        NEW_ARR_A(void *, res, n);
 
        for (i = 0; i < n; ++i) {