bugfix
[libfirm] / ir / ir / irvrfy.c
index 722a7f3..e898a0c 100644 (file)
  */
 
 #ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
 #endif
 
 # include "irprog.h"
 # include "irgraph_t.h"
+# include "ircgcons.h"
 # include "irvrfy.h"
 # include "irgwalk.h"
 # include "irdump.h"
@@ -36,7 +37,8 @@
 #define ASSERT_AND_RET(expr, string, ret) \
 do { \
   if (opt_do_node_verification == NODE_VERIFICATION_ON) {\
-    if (!(expr)) dump_ir_block_graph(current_ir_graph, "-assert"); \
+    if (!(expr) && current_ir_graph != get_const_code_irg()) \
+    dump_ir_block_graph(current_ir_graph, "-assert"); \
     assert((expr) && string); } \
   if (!(expr)) { \
     if (opt_do_node_verification == NODE_VERIFICATION_REPORT) \
@@ -132,6 +134,24 @@ static void show_unop_failure(ir_node *n, const char *text)
       text);
 }
 
+/**
+ * Prints a failure message for an op with 3 operands
+ */
+static void show_triop_failure(ir_node *n, const char *text)
+{
+  ir_node *op0  = get_irn_n(n, 0);
+  ir_node *op1  = get_irn_n(n, 1);
+  ir_node *op2  = get_irn_n(n, 2);
+
+  fprintf(stderr, "\nFIRM: irn_vrfy_irg() of node %ld %s%s(%s%s, %s%s, %s%s) did not match (%s)\n",
+      get_irn_node_nr(n),
+      get_irn_opname(n), get_irn_modename(n),
+      get_irn_opname(op0), get_irn_modename(op0),
+      get_irn_opname(op1), get_irn_modename(op1),
+      get_irn_opname(op2), get_irn_modename(op2),
+      text);
+}
+
 /**
  * Prints a failure message for a proj
  */
@@ -289,10 +309,10 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
 
     case iro_Cond:
       ASSERT_AND_RET_DBG(
-       (
-          (proj >= 0 && mode == mode_X && get_irn_mode(get_Cond_selector(pred)) == mode_b) ||  /* compare */
-         (mode == mode_X && mode_is_int(get_irn_mode(get_Cond_selector(pred))))                /* switch */
-       ),
+        (
+          (proj >= 0 && mode == mode_X && get_irn_mode(get_Cond_selector(pred)) == mode_b) ||   /* compare */
+          (mode == mode_X && mode_is_int(get_irn_mode(get_Cond_selector(pred))))                /* switch */
+        ),
         "wrong Proj from Cond", 0,
         show_proj_failure(p);
       );
@@ -324,18 +344,7 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
         "wrong Proj from Call", 0,
         show_proj_failure(p);
       );
-      break;
 
-    case iro_FuncCall:
-      ASSERT_AND_RET_DBG(
-        ((proj == pn_Call_M_regular        && mode == mode_M) ||
-         (proj == pn_Call_X_except         && mode == mode_X) ||
-         (proj == pn_Call_T_result         && mode == mode_T) ||
-         (proj == pn_Call_M_except         && mode == mode_M) ||
-     (proj == pn_Call_P_value_res_base && mode == mode_P)),
-        "wrong Proj from FuncCall", 0,
-        show_proj_failure(p);
-      );
       break;
 
     case iro_Quot:
@@ -365,7 +374,7 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
          (proj == pn_Div_X_except && mode == mode_X) ||
          (proj == pn_Div_res      && mode_is_int(mode))),
         "wrong Proj from Div or Mod", 0,
-    show_proj_failure(p);
+        show_proj_failure(p);
       );
       break;
 
@@ -389,31 +398,31 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
 
     case iro_Load:
       if (proj == pn_Load_res) {
-       ir_node *ptr = get_Load_ptr(pred);
-       entity *ent = get_ptr_entity(ptr);
-
-       if (vrfy_entities && ent && get_irg_phase_state(current_ir_graph) == phase_high) {
-         /* do NOT check this for lowered phases, see comment on Store */
-         ASSERT_AND_RET_DBG(
-                            (mode == get_type_mode(get_entity_type(ent))),
-                            "wrong data Proj from Load, entity type_mode failed", 0,
-                            show_proj_failure_ent(p, ent);
-                            );
-       }
-       else {
-         ASSERT_AND_RET_DBG(
-                            mode_is_data(mode) && mode == get_Load_mode(pred),
-                            "wrong data Proj from Load", 0,
-                            show_proj_failure(p);
-                            );
-       }
+        ir_node *ptr = get_Load_ptr(pred);
+        entity *ent = get_ptr_entity(ptr);
+
+        if (vrfy_entities && ent && get_irg_phase_state(current_ir_graph) == phase_high) {
+          /* do NOT check this for lowered phases, see comment on Store */
+          ASSERT_AND_RET_DBG(
+                             (mode == get_type_mode(get_entity_type(ent))),
+                             "wrong data Proj from Load, entity type_mode failed", 0,
+                             show_proj_failure_ent(p, ent);
+                             );
+        }
+        else {
+          ASSERT_AND_RET_DBG(
+                             mode_is_data(mode) && mode == get_Load_mode(pred),
+                             "wrong data Proj from Load", 0,
+                             show_proj_failure(p);
+                             );
+        }
       } else {
-       ASSERT_AND_RET_DBG(
-                          ((proj == pn_Load_M        && mode == mode_M) ||
-                           (proj == pn_Load_X_except && mode == mode_X)),
-                          "wrong Proj from Load", 0,
-                          show_proj_failure(p);
-                          );
+        ASSERT_AND_RET_DBG(
+                           ((proj == pn_Load_M        && mode == mode_M) ||
+                            (proj == pn_Load_X_except && mode == mode_X)),
+                           "wrong Proj from Load", 0,
+                           show_proj_failure(p);
+                           );
       }
       break;
 
@@ -450,31 +459,31 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
           case iro_Start:
             mt = get_entity_type(get_irg_entity(irg));
 
-        if (nr == pn_Start_T_args) {
-              ASSERT_AND_RET(
-                  (proj >= 0 && mode_is_data(mode)),
-                  "wrong Proj from Proj from Start", 0);
-              ASSERT_AND_RET(
-                (proj < get_method_n_params(mt)),
-                "More Projs for args than args in type", 0
-              );
-              if ((mode_is_reference(mode)) && is_compound_type(get_method_param_type(mt, proj)))
-                /* value argument */ break;
-
+            if (nr == pn_Start_T_args) {
+                  ASSERT_AND_RET(
+                      (proj >= 0 && mode_is_data(mode)),
+                      "wrong Proj from Proj from Start", 0);
+                  ASSERT_AND_RET(
+                    (proj < get_method_n_params(mt)),
+                    "More Projs for args than args in type", 0
+                  );
+                  if ((mode_is_reference(mode)) && is_compound_type(get_method_param_type(mt, proj)))
+                    /* value argument */ break;
+
+                  ASSERT_AND_RET(
+                      (mode == get_type_mode(get_method_param_type(mt, proj))),
+                      "Mode of Proj from Start doesn't match mode of param type.", 0);
+                }
+            else if (nr == pn_Start_P_value_arg_base) {
               ASSERT_AND_RET(
-                  (mode == get_type_mode(get_method_param_type(mt, proj))),
-                  "Mode of Proj from Start doesn't match mode of param type.", 0);
+                      (proj >= 0 && mode_is_reference(mode)),
+                      "wrong Proj from Proj from Start", 0
+                  );
+                  ASSERT_AND_RET(
+                    (proj < get_method_n_params(mt)),
+                    "More Projs for args than args in type", 0
+                  );
             }
-        else if (nr == pn_Start_P_value_arg_base) {
-          ASSERT_AND_RET(
-                  (proj >= 0 && mode_is_reference(mode)),
-                  "wrong Proj from Proj from Start", 0
-              );
-              ASSERT_AND_RET(
-                (proj < get_method_n_params(mt)),
-                "More Projs for args than args in type", 0
-              );
-        }
             break;
 
           case iro_Call:
@@ -495,28 +504,14 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
             }
             break;
 
-          case iro_FuncCall:
-            {
-              ASSERT_AND_RET(
-                  (proj >= 0 && mode_is_data(mode)),
-                  "wrong Proj from Proj from FuncCall", 0);
-              mt = get_FuncCall_type(pred);
-              ASSERT_AND_RET(
-                  (proj < get_method_n_ress(mt)),
-                  "More Projs for results than results in type.", 0);
-              if ((mode_is_reference(mode)) && is_compound_type(get_method_res_type(mt, proj)))
-                /* value result */ break;
-
-              ASSERT_AND_RET(
-                  (mode == get_type_mode(get_method_res_type(mt, proj))),
-                  "Mode of Proj from FuncCall doesn't match mode of result type.", 0);
-            }
-            break;
-
           case iro_Tuple:
             /* We don't test */
             break;
 
+          case iro_Bad:
+            /* hmm, optimization did not remove it */
+            break;
+
           default:
             ASSERT_AND_RET(0, "Unknown opcode", 0);
         }
@@ -531,9 +526,13 @@ vrfy_Proj_proj(ir_node *p, ir_graph *irg) {
       break;
 
     case iro_EndReg:
+      ASSERT_AND_RET((get_irp_ip_view_state() != ip_view_no),
+                     "EndReg may only appear if ip view is constructed.", 0);
       break;
 
     case iro_EndExcept:
+      ASSERT_AND_RET((get_irp_ip_view_state() != ip_view_no),
+                     "EndExcept may only appear if ip view is constructed.", 0);
       break;
 
     default:
@@ -559,7 +558,7 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
 
   if (!opt_do_node_verification) return 1;
 
-  if (! interprocedural_view) {
+  if (! get_interprocedural_view()) {
     /*
      * do NOT check placement in interprocedural view, as we don't always know
      * the "right" graph ...
@@ -569,6 +568,7 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
                        "Node is not stored on proper IR graph!", 0,
                        show_node_on_graph(irg, n);
                        );
+    assert(get_irn_irg(n) == irg);
   }
 
   opcode = get_irn_opcode(n);
@@ -609,7 +609,7 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
                          "End Block node", 0);
         }
       /*  irg attr must == graph we are in. */
-      if (! interprocedural_view) {
+      if (! get_interprocedural_view()) {
         ASSERT_AND_RET(((get_irn_irg(n) && get_irn_irg(n) == irg)), "Block node has wrong irg attribute", 0);
       }
 
@@ -630,10 +630,13 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       break;
 
     case iro_Break:
+      ASSERT_AND_RET((get_irp_ip_view_state() != ip_view_no),
+                     "Break may only appear if ip view is constructed.", 0);
       ASSERT_AND_RET(
                      /* Jmp: BB --> X */
-                     mymode == mode_X, "Jmp node", 0
+                     mymode == mode_X, "Break node", 0
                      );
+
       break;
 
     case iro_Cond:
@@ -662,22 +665,22 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
         "Number of results for Return doesn't match number of results in type.", 0,
       show_return_nres(irg, n, mt););
       for (i = 0; i < get_Return_n_ress(n); i++) {
-    type *res_type = get_method_res_type(mt, i);
+        type *res_type = get_method_res_type(mt, i);
 
         if (is_atomic_type(res_type)) {
-      ASSERT_AND_RET_DBG(
-        get_irn_mode(get_Return_res(n, i)) == get_type_mode(res_type),
-        "Mode of result for Return doesn't match mode of result type.", 0,
-        show_return_modes(irg, n, mt, i);
-      );
-    }
-    else {
-      ASSERT_AND_RET_DBG(
-        mode_is_reference(get_irn_mode(get_Return_res(n, i))),
-        "Mode of result for Return doesn't match mode of result type.", 0,
-        show_return_modes(irg, n, mt, i);
-      );
-    }
+          ASSERT_AND_RET_DBG(
+            get_irn_mode(get_Return_res(n, i)) == get_type_mode(res_type),
+            "Mode of result for Return doesn't match mode of result type.", 0,
+            show_return_modes(irg, n, mt, i);
+          );
+        }
+        else {
+          ASSERT_AND_RET_DBG(
+            mode_is_reference(get_irn_mode(get_Return_res(n, i))),
+            "Mode of result for Return doesn't match mode of result type.", 0,
+            show_return_modes(irg, n, mt, i);
+          );
+        }
       }
       break;
 
@@ -693,22 +696,22 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
 
     case iro_Const: {
       ASSERT_AND_RET(
-                    /* Const: BB --> data */
-                    (mode_is_data (mymode) ||
-                     mymode == mode_b)      /* we want boolean constants for static evaluation */
-                    ,"Const node", 0        /* of Cmp. */
-                    );
+                     /* Const: BB --> data */
+                     (mode_is_data (mymode) ||
+                      mymode == mode_b)      /* we want boolean constants for static evaluation */
+                     ,"Const node", 0        /* of Cmp. */
+                     );
       } break;
     case iro_SymConst:
       if (get_SymConst_kind(n) == symconst_addr_ent) {
-       entity *ent = get_SymConst_entity(n);
-       if (is_method_type(get_entity_type(ent)) &&
-           get_irn_irg(n) != get_const_code_irg()) {
+        entity *ent = get_SymConst_entity(n);
+        if (is_Method_type(get_entity_type(ent)) &&
+            get_irn_irg(n) != get_const_code_irg()) {
 #if 1
-         ASSERT_AND_RET((get_entity_peculiarity(ent) != peculiarity_description),
-                        "A constant must address an existing method.", 0);
+          ASSERT_AND_RET((get_entity_peculiarity(ent) != peculiarity_description),
+                         "A constant must address an existing method.", 0);
 #endif
-       }
+        }
       }
       ASSERT_AND_RET(
                      /* SymConst: BB --> int*/
@@ -745,12 +748,17 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       /* Call: BB x M x ref x data1 x ... x datan
          --> M x datan+1 x ... x data n+m */
       ASSERT_AND_RET( op1mode == mode_M && mode_is_reference(op2mode), "Call node", 0 );  /* operand M x ref */
+
+      mt = get_Call_type(n);
+      if(get_unknown_type() == mt) {
+        break;
+      }
+
       for (i=3; i < get_irn_arity(n); i++) {
         ASSERT_AND_RET( mode_is_data(get_irn_mode(in[i])), "Call node", 0 );  /* operand datai */
       };
       ASSERT_AND_RET( mymode == mode_T, "Call result not a tuple", 0 );   /* result T */
       /* Compare arguments of node with those of type */
-      mt = get_Call_type(n);
 
       if (get_method_variadicity(mt) == variadicity_variadic) {
         ASSERT_AND_RET_DBG(
@@ -769,24 +777,32 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       }
 
       for (i = 0; i < get_method_n_params(mt); i++) {
-    type *t = get_method_param_type(mt, i);
+        type *t = get_method_param_type(mt, i);
 
-    if (is_atomic_type(t)) {
-      ASSERT_AND_RET_DBG(
-          get_irn_mode(get_Call_param(n, i)) == get_type_mode(t),
-          "Mode of arg for Call doesn't match mode of arg type.", 0,
-      show_call_param(n, mt);
-      );
-    }
-    else {
-      /* call with a compound type, mode must be reference */
-      ASSERT_AND_RET_DBG(
-          mode_is_reference(get_irn_mode(get_Call_param(n, i))),
-          "Mode of arg for Call doesn't match mode of arg type.", 0,
-      show_call_param(n, mt);
-      );
-    }
+        if (is_atomic_type(t)) {
+          ASSERT_AND_RET_DBG(
+                             get_irn_mode(get_Call_param(n, i)) == get_type_mode(t),
+                             "Mode of arg for Call doesn't match mode of arg type.", 0,
+                             show_call_param(n, mt);
+                             );
+        }
+        else {
+          /* call with a compound type, mode must be reference */
+          ASSERT_AND_RET_DBG(
+                             mode_is_reference(get_irn_mode(get_Call_param(n, i))),
+                             "Mode of arg for Call doesn't match mode of arg type.", 0,
+                             show_call_param(n, mt);
+                             );
+        }
       }
+
+#if 0
+      if (Call_has_callees(n)) {
+        for (i = 0; i < get_Call_n_callees(n); i++) {
+          ASSERT_AND_RET(is_entity(get_Call_callee(n, i)), "callee array must contain entities.", 0);
+        }
+      }
+#endif
       break;
 
     case iro_Add:
@@ -843,9 +859,9 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
     case iro_Minus:
       op1mode = get_irn_mode(in[1]);
       ASSERT_AND_RET_DBG(
-                         /* Minus: BB x float --> float */
-                         op1mode == mymode && mode_is_float(op1mode), "Minus node", 0,
-                         show_unop_failure(n , "/* Minus: BB x float --> float */");
+                         /* Minus: BB x num --> num */
+                         op1mode == mymode && mode_is_num(op1mode), "Minus node", 0,
+                         show_unop_failure(n , "/* Minus: BB x num --> num */");
                          );
       op_is_symmetric = 2;
       break;
@@ -1014,6 +1030,7 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
                          );
       break;
 
+
     case iro_Phi:
     {
       ir_node *block = get_nodes_block(n);
@@ -1021,10 +1038,10 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       if (! is_Bad(block) && get_irg_phase_state(get_irn_irg(n)) != phase_building) {
         /* a Phi node MUST have the same number of inputs as its block */
         ASSERT_AND_RET_DBG(
-         get_irn_arity(n) == get_irn_arity(block),
-         "wrong number of inputs in Phi node", 0,
-         show_phi_inputs(n, block);
-       );
+          get_irn_arity(n) == get_irn_arity(block),
+          "wrong number of inputs in Phi node", 0,
+          show_phi_inputs(n, block);
+        );
       }
 
       /* Phi: BB x dataM^n --> dataM */
@@ -1039,6 +1056,11 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       ASSERT_AND_RET( mode_is_dataM(mymode), "Phi node", 0 );
       break;
     }
+    case iro_Filter:
+      ASSERT_AND_RET((get_irp_ip_view_state() != ip_view_no),
+                   "Filter may only appear if ip view is constructed.", 0);
+      /* We should further do tests as for Proj and Phi. */
+      break;
     case iro_Load:
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
@@ -1066,7 +1088,9 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
 
       break;
 
-    case iro_Store:
+    case iro_Store: {
+      entity *target;
+
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       op3mode = get_irn_mode(in[3]);
@@ -1077,18 +1101,19 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
                      );
       ASSERT_AND_RET(mymode == mode_T, "Store node", 0);
 
-      entity *target = get_ptr_entity(in[2]);
+      target = get_ptr_entity(in[2]);
       if (vrfy_entities && target && get_irg_phase_state(current_ir_graph) == phase_high) {
-       /*
-        * If lowered code, any Sels that add 0 may be removed, causing
-        * an direct access to entities of array or compound type.
-        * Prevent this by checking the phase.
-        */
-       ASSERT_AND_RET( op3mode == get_type_mode(get_entity_type(target)),
-                       "Store node", 0);
+        /*
+         * If lowered code, any Sels that add 0 may be removed, causing
+         * an direct access to entities of array or compound type.
+         * Prevent this by checking the phase.
+         */
+        ASSERT_AND_RET( op3mode == get_type_mode(get_entity_type(target)),
+                        "Store node", 0);
       }
 
       break;
+    }
 
     case iro_Alloc:
       op1mode = get_irn_mode(in[1]);
@@ -1107,12 +1132,15 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
     case iro_Free:
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
+      op3mode = get_irn_mode(in[3]);
       ASSERT_AND_RET_DBG(
-                         /* Free: BB x M x ref --> M */
+                         /* Free: BB x M x ref x int_u --> M */
                          op1mode == mode_M && mode_is_reference(op2mode) &&
+                         mode_is_int(op3mode) &&
+                         !mode_is_signed(op3mode) &&
                          mymode == mode_M,
                          "Free node", 0,
-                         show_binop_failure(n, "/* Free: BB x M x ref --> M */");
+                         show_triop_failure(n, "/* Free: BB x M x ref x int_u --> M */");
                          );
       break;
 
@@ -1140,6 +1168,20 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
                          );
       break;
 
+    case iro_Mux:
+      op1mode = get_irn_mode(in[1]);
+      op2mode = get_irn_mode(in[2]);
+      op3mode = get_irn_mode(in[3]);
+      ASSERT_AND_RET(
+                         /* Mux: BB x b x numP x numP --> numP */
+                         op1mode == mode_b &&
+                         op2mode == mymode &&
+                         op3mode == mymode &&
+                         mode_is_numP(mymode),
+                         "Mux node", 0
+                         );
+      break;
+
     default:
       break;
     }
@@ -1229,16 +1271,16 @@ static void check_bads(ir_node *node, void *env)
       for (i = 0; i < arity; ++i) {
         ir_node *pred = get_irn_n(node, i);
 
-       if (is_Bad(pred)) {
-         venv->res |= BAD_CF;
+        if (is_Bad(pred)) {
+          venv->res |= BAD_CF;
 
-         if (opt_do_node_verification == NODE_VERIFICATION_REPORT) {
-           fprintf(stderr, "irg_vrfy_bads: Block %ld has Bad predecessor\n", get_irn_node_nr(node));
-         }
-         if (opt_do_node_verification == NODE_VERIFICATION_ON) {
-           assert(0 && "Bad CF detected");
-         }
-       }
+          if (opt_do_node_verification == NODE_VERIFICATION_REPORT) {
+            fprintf(stderr, "irg_vrfy_bads: Block %ld has Bad predecessor\n", get_irn_node_nr(node));
+          }
+          if (opt_do_node_verification == NODE_VERIFICATION_ON) {
+            assert(0 && "Bad CF detected");
+          }
+        }
       }
     }
   }
@@ -1247,27 +1289,27 @@ static void check_bads(ir_node *node, void *env)
 
       /* check for Bad Block */
       if (is_Bad(get_nodes_block(node))) {
-       venv->res |= BAD_BLOCK;
-
-       if (opt_do_node_verification == NODE_VERIFICATION_REPORT) {
-         fprintf(stderr, "irg_vrfy_bads: node %ld has Bad Block\n", get_irn_node_nr(node));
-       }
-       if (opt_do_node_verification == NODE_VERIFICATION_ON) {
-         assert(0 && "Bad CF detected");
-       }
+        venv->res |= BAD_BLOCK;
+
+        if (opt_do_node_verification == NODE_VERIFICATION_REPORT) {
+          fprintf(stderr, "irg_vrfy_bads: node %ld has Bad Block\n", get_irn_node_nr(node));
+        }
+        if (opt_do_node_verification == NODE_VERIFICATION_ON) {
+          assert(0 && "Bad CF detected");
+        }
       }
     }
 
     if ((venv->flags & TUPLE) == 0) {
       if (get_irn_op(node) == op_Tuple) {
-       venv->res |= TUPLE;
-
-       if (opt_do_node_verification == NODE_VERIFICATION_REPORT) {
-         fprintf(stderr, "irg_vrfy_bads: node %ld is a Tuple\n", get_irn_node_nr(node));
-       }
-       if (opt_do_node_verification == NODE_VERIFICATION_ON) {
-         assert(0 && "Tuple detected");
-       }
+        venv->res |= TUPLE;
+
+        if (opt_do_node_verification == NODE_VERIFICATION_REPORT) {
+          fprintf(stderr, "irg_vrfy_bads: node %ld is a Tuple\n", get_irn_node_nr(node));
+        }
+        if (opt_do_node_verification == NODE_VERIFICATION_ON) {
+          assert(0 && "Tuple detected");
+        }
       }
     }
 
@@ -1275,33 +1317,33 @@ static void check_bads(ir_node *node, void *env)
       ir_node *pred = get_irn_n(node, i);
 
       if (is_Bad(pred)) {
-       /* check for Phi with Bad inputs */
-       if (is_Phi(node) && !is_Bad(get_nodes_block(node)) && is_Bad(get_irn_n(get_nodes_block(node), i))) {
-         if (venv->flags & BAD_CF)
-           continue;
-         else {
-           venv->res |= BAD_CF;
-
-           if (opt_do_node_verification == NODE_VERIFICATION_REPORT) {
-             fprintf(stderr, "irg_vrfy_bads: Phi %ld has Bad Input\n", get_irn_node_nr(node));
-           }
-           if (opt_do_node_verification == NODE_VERIFICATION_ON) {
-             assert(0 && "Bad CF detected");
-           }
-         }
-       }
-
-       /* Bad node input */
-       if ((venv->flags & BAD_DF) == 0) {
-         venv->res |= BAD_DF;
-
-         if (opt_do_node_verification == NODE_VERIFICATION_REPORT) {
-           fprintf(stderr, "irg_vrfy_bads: node %ld has Bad Input\n", get_irn_node_nr(node));
-         }
-         if (opt_do_node_verification == NODE_VERIFICATION_ON) {
-           assert(0 && "Bad NON-CF detected");
-         }
-       }
+        /* check for Phi with Bad inputs */
+        if (is_Phi(node) && !is_Bad(get_nodes_block(node)) && is_Bad(get_irn_n(get_nodes_block(node), i))) {
+          if (venv->flags & BAD_CF)
+            continue;
+          else {
+            venv->res |= BAD_CF;
+
+            if (opt_do_node_verification == NODE_VERIFICATION_REPORT) {
+              fprintf(stderr, "irg_vrfy_bads: Phi %ld has Bad Input\n", get_irn_node_nr(node));
+            }
+            if (opt_do_node_verification == NODE_VERIFICATION_ON) {
+              assert(0 && "Bad CF detected");
+            }
+          }
+        }
+
+        /* Bad node input */
+        if ((venv->flags & BAD_DF) == 0) {
+          venv->res |= BAD_DF;
+
+          if (opt_do_node_verification == NODE_VERIFICATION_REPORT) {
+            fprintf(stderr, "irg_vrfy_bads: node %ld has Bad Input\n", get_irn_node_nr(node));
+          }
+          if (opt_do_node_verification == NODE_VERIFICATION_ON) {
+            assert(0 && "Bad NON-CF detected");
+          }
+        }
       }
     }
   }