- put only Phi nodes into th Phi list
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 26 Nov 2008 11:38:27 +0000 (11:38 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 26 Nov 2008 11:38:27 +0000 (11:38 +0000)
[r24012]

ir/lower/lower_dw.c

index ccef070..4b9412a 100644 (file)
@@ -2150,9 +2150,12 @@ static void lower_Phi(ir_node *phi, ir_mode *mode, lower_env_t *env) {
        env->entries[idx]->low_word  = phi_l = new_rd_Phi(dbg, irg, block, arity, inl, mode_l);
        env->entries[idx]->high_word = phi_h = new_rd_Phi(dbg, irg, block, arity, inh, mode);
 
-       /* Don't forget to link the new Phi nodes into the block! */
-       add_Block_phi(block, phi_l);
-       add_Block_phi(block, phi_h);
+       /* Don't forget to link the new Phi nodes into the block.
+        * Beware that some Phis might be optimized away. */
+       if (is_Phi(phi_l))
+               add_Block_phi(block, phi_l);
+       if (is_Phi(phi_h))
+               add_Block_phi(block, phi_h);
 
        if (enq) {
                /* not yet finished */