- Fixed masking of upper nibble of bitfield constants for tarval string output.
[libfirm] / ir / be / beirgmod.c
index 0023c2d..49dca99 100644 (file)
@@ -184,10 +184,23 @@ static void remove_empty_block(ir_node *block)
 
                assert(succ_block == NULL);
                succ_block = get_edge_src_irn(edge);
+               if (has_Block_label(succ_block) && has_Block_label(block)) {
+                       /*
+                        * Currently we can add only one label for a block.
+                        * Therefore we cannot combine them if  both block already have one.
+                        */
+                       goto check_preds;
+               }
 
                set_irn_n(succ_block, pos, pred);
        }
 
+       if (has_Block_label(block)) {
+               /* move the label to the successor block */
+               ir_label_t label = get_Block_label(block);
+               set_Block_label(succ_block, label);
+       }
+
        /* there can be some non-scheduled Pin nodes left in the block, move them
         * to the succ block (Pin) or pred block (Sync) */
        foreach_out_edge_safe(block, edge, next) {
@@ -201,8 +214,11 @@ static void remove_empty_block(ir_node *block)
                        assert(get_Block_MacroBlock(node) == block && "Wrong Block->Block edge");
                        continue;
                }
+               /* we simply kill Pins, because there are some strange interactions
+                * between condeval, which produce PhiMs with Pins, we simply kill
+                * the pins here, everything is scheduled anyway */
                if (is_Pin(node)) {
-                       set_nodes_block(node, succ_block);
+                       exchange(node, get_Pin_op(node));
                        continue;
                }
                if (is_Sync(node)) {
@@ -217,12 +233,6 @@ static void remove_empty_block(ir_node *block)
                panic("Unexpected node %+F in block %+F with empty schedule", node, block);
        }
 
-       if (has_Block_label(block)) {
-               /* move the label to the successor block */
-               ir_label_t label = get_Block_label(block);
-               set_Block_label(succ_block, label);
-       }
-
        set_Block_cfgpred(block, 0, new_Bad());
        kill_node(jump);
        blocks_removed = 1;