- Changed keep logic: all nodes can be keeped yet, thi is necessary to fix fehler152
[libfirm] / ir / ir / irvrfy.c
index e5982cd..457bc62 100644 (file)
@@ -868,18 +868,23 @@ static int verify_node_Block(ir_node *n, ir_graph *irg) {
 
                /* Blocks with more than one predecessor must be header blocks */
                ASSERT_AND_RET(get_Block_n_cfgpreds(n) == 1, "partBlock with more than one predecessor", 0);
-               pred = get_Block_cfgpred(n, 0);
-               if (is_Proj(pred)) {
-                       /* the predecessor MUST be a regular Proj */
-                       ir_node *frag_op = get_Proj_pred(pred);
-                       ASSERT_AND_RET(is_fragile_op(frag_op) && get_Proj_proj(pred) == pn_Generic_X_regular,
-                               "partBlock with non-regular predecessor", 0);
+               if (get_irg_phase_state(irg) != phase_backend) {
+                       pred = get_Block_cfgpred(n, 0);
+                       if (is_Proj(pred)) {
+                               /* the predecessor MUST be a regular Proj */
+                               ir_node *frag_op = get_Proj_pred(pred);
+                               ASSERT_AND_RET(
+                                       is_fragile_op(frag_op) && get_Proj_proj(pred) == pn_Generic_X_regular,
+                                       "partBlock with non-regular predecessor", 0);
+                       } else {
+                               /* We allow Jmps to be predecessors of partBlocks. This can happen due to optimization
+                                  of fragile nodes during construction. It does not violate our assumption of dominance
+                                  so let it. */
+                               ASSERT_AND_RET(is_Jmp(pred) || is_Bad(pred),
+                                       "partBlock with non-regular predecessor", 0);
+                       }
                } else {
-                       /* We allow Jmps to be predecessors of partBlocks. This can happen due to optimization
-                          of fragile nodes during construction. It does not violate our assumption of dominance
-                          so let it. */
-                       ASSERT_AND_RET(is_Jmp(pred) || is_Bad(pred),
-                               "partBlock with non-regular predecessor", 0);
+                       /* relax in backend: Bound nodes are probably lowered into conditional jumps */
                }
        }
 
@@ -1274,15 +1279,12 @@ static int verify_node_Sub(ir_node *n, ir_graph *irg) {
                        (mymode ==op1mode && mymode == op2mode && mode_is_data(op1mode)) ||
                        /* Pointer Sub: BB x ref x int --> ref */
                        (op1mode == mymode && mode_is_int(op2mode) && mode_is_reference(mymode)) ||
-                       /* Pointer Sub: BB x int x ref --> ref */
-                       (mode_is_int(op1mode) && op2mode == mymode && mode_is_reference(mymode)) ||
                        /* Pointer Sub: BB x ref x ref --> int */
                        (op1mode == op2mode && mode_is_reference(op2mode) && mode_is_int(mymode))
                ),
                "Sub node", 0,
                show_binop_failure(n, "/* common Sub: BB x numP x numP --> numP */ |\n"
                        "/* Pointer Sub: BB x ref x int --> ref */   |\n"
-                       "/* Pointer Sub: BB x int x ref --> ref */   |\n"
                        "/* Pointer Sub: BB x ref x ref --> int */" );
                );
        return 1;
@@ -1822,11 +1824,11 @@ static int verify_node_Mux(ir_node *n, ir_graph *irg) {
        (void) irg;
 
        ASSERT_AND_RET(
-               /* Mux: BB x b x numP x numP --> numP */
+               /* Mux: BB x b x datab x datab --> datab */
                op1mode == mode_b &&
                op2mode == mymode &&
                op3mode == mymode &&
-               mode_is_data(mymode),
+               mode_is_datab(mymode),
                "Mux node", 0
                );
        return 1;