cg_opt now frees interprocedural loop information automatically since
[libfirm] / ir / ir / irvrfy.c
index 05e318a..29f1c26 100644 (file)
@@ -27,7 +27,7 @@
 
 /*
  * in RELEASE mode, returns ret if the expression expr evaluates to zero
- * in ASSERT mode, executes blk if the expression expr evaluates to zero and asserts
+ * in ASSERT mode, executes blk if the expression expr evaluates to zero and asserts expr
  */
 #define ASSERT_AND_RET_DBG(expr, string, ret, blk)      if (!(expr)) return (ret)
 #else
@@ -64,6 +64,24 @@ ir_node **get_irn_in(ir_node *node);
 static node_verification_t opt_do_node_verification = NODE_VERIFICATION_ON;
 static const char *bad_msg;
 
+
+/** Borrowed from interprete.c
+static entity *hunt_for_entity (ir_node *addr, ir_node *load) {
+  ir_op *op = get_irn_op(addr);
+  if (op == op_Sel)
+    return get_Sel_entity(addr);
+  if (op == op_Const) {
+    tarval *tv = get_Const_tarval(addr);
+    assert(tarval_is_entity(tv));
+    return get_tarval_entity(tv);
+  }
+
+  if(get_irn_opcode(load) == iro_Load)
+    return(NULL);
+  assert(0 && "unexpected address expression.");
+  return NULL;
+}
+*/
 /**
  * little helper for NULL modes
  */
@@ -519,8 +537,8 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
   int opcode, opcode1;
   ir_mode *mymode, *op1mode = NULL, *op2mode, *op3mode;
   int op_is_symmetric = 1;  /*  0: asymmetric
-                1: operands have identical modes
-                2: modes of operands == mode of this node */
+                                                               1: operands have identical modes
+                                                               2: modes of operands == mode of this node */
   type *mt;                 /* A method type */
   entity *ent;
 
@@ -534,10 +552,10 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
      * the "right" graph ...
      */
     ASSERT_AND_RET_DBG(
-      node_is_in_irgs_storage(irg, n),
-      "Node is not stored on proper IR graph!", 0,
-      show_node_on_graph(irg, n);
-    );
+                                          node_is_in_irgs_storage(irg, n),
+                                          "Node is not stored on proper IR graph!", 0,
+                                          show_node_on_graph(irg, n);
+                                          );
   }
 
   opcode = get_irn_opcode(n);
@@ -555,65 +573,65 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
   in = get_irn_in(n);
 
   switch (opcode)
-  {
+       {
 
     case iro_Block:
       for (i = 0; i < get_Block_n_cfgpreds(n); ++i) {
-    ir_node *pred =  get_Block_cfgpred(n, i);
-    ASSERT_AND_RET(
-      (is_Bad(pred)     ||
-       is_Unknown(pred) ||
-       (get_irn_mode(pred) == mode_X)
-      ), "Block node", 0);
+               ir_node *pred =  get_Block_cfgpred(n, i);
+               ASSERT_AND_RET(
+                                          (is_Bad(pred)     ||
+                                               is_Unknown(pred) ||
+                                               (get_irn_mode(pred) == mode_X)
+                                               ), "Block node", 0);
       }
       /*  End block may only have Return, Raise or fragile ops as preds. */
       if (n == get_irg_end_block(irg))
-    for (i = 0; i < get_Block_n_cfgpreds(n); ++i) {
-      ir_node *pred =  skip_Proj(get_Block_cfgpred(n, i));
-      if (is_Proj(pred) || get_irn_op(pred) == op_Tuple)
-        break;   /*  We can not test properly.  How many tuples are there? */
-      ASSERT_AND_RET(((get_irn_op(pred) == op_Return) ||
-              is_Bad(pred)                    ||
-              (get_irn_op(pred) == op_Raise)  ||
-              is_fragile_op(pred)               ),
-             "End Block node", 0);
-    }
+               for (i = 0; i < get_Block_n_cfgpreds(n); ++i) {
+                 ir_node *pred =  skip_Proj(get_Block_cfgpred(n, i));
+                 if (is_Proj(pred) || get_irn_op(pred) == op_Tuple)
+                       break;   /*  We can not test properly.  How many tuples are there? */
+                 ASSERT_AND_RET(((get_irn_op(pred) == op_Return) ||
+                                                 is_Bad(pred)                    ||
+                                                 (get_irn_op(pred) == op_Raise)  ||
+                                                 is_fragile_op(pred)               ),
+                                                "End Block node", 0);
+               }
       /*  irg attr must == graph we are in. */
       if (! interprocedural_view) {
-    ASSERT_AND_RET(((get_irn_irg(n) && get_irn_irg(n) == irg)), "Block node has wrong irg attribute", 0);
+               ASSERT_AND_RET(((get_irn_irg(n) && get_irn_irg(n) == irg)), "Block node has wrong irg attribute", 0);
       }
 
       break;
 
     case iro_Start:
       ASSERT_AND_RET(
-          /* Start: BB --> X x M x ref x data1 x ... x datan x ref */
-          mymode == mode_T, "Start node", 0
-          );
+                                        /* Start: BB --> X x M x ref x data1 x ... x datan x ref */
+                                        mymode == mode_T, "Start node", 0
+                                        );
       break;
 
     case iro_Jmp:
       ASSERT_AND_RET(
-          /* Jmp: BB --> X */
-          mymode == mode_X, "Jmp node", 0
-          );
+                                        /* Jmp: BB --> X */
+                                        mymode == mode_X, "Jmp node", 0
+                                        );
       break;
 
     case iro_Break:
       ASSERT_AND_RET(
-          /* Jmp: BB --> X */
-          mymode == mode_X, "Jmp node", 0
-          );
+                                        /* Jmp: BB --> X */
+                                        mymode == mode_X, "Jmp node", 0
+                                        );
       break;
 
     case iro_Cond:
       op1mode = get_irn_mode(in[1]);
       ASSERT_AND_RET(
-          /* Cond: BB x b --> X x X */
-          (op1mode == mode_b ||
-           /* Cond: BB x int --> X^n */
-           mode_is_int(op1mode) ),  "Cond node", 0
-          );
+                                        /* Cond: BB x b --> X x X */
+                                        (op1mode == mode_b ||
+                                         /* Cond: BB x int --> X^n */
+                                         mode_is_int(op1mode) ),  "Cond node", 0
+                                        );
       ASSERT_AND_RET(mymode == mode_T, "Cond mode is not a tuple", 0);
       break;
 
@@ -655,42 +673,42 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       ASSERT_AND_RET(
-          /* Sel: BB x M x ref --> X x M */
-          op1mode == mode_M && mode_is_reference(op2mode) &&
-          mymode == mode_T, "Raise node", 0
-          );
+                                        /* Sel: BB x M x ref --> X x M */
+                                        op1mode == mode_M && mode_is_reference(op2mode) &&
+                                        mymode == mode_T, "Raise node", 0
+                                        );
       break;
 
     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:
       ASSERT_AND_RET(
-          /* SymConst: BB --> int*/
-          (mode_is_int(mymode) ||
-           /* SymConst: BB --> ref */
-           mode_is_reference(mymode))
-          ,"SymConst node", 0);
+                                        /* SymConst: BB --> int*/
+                                        (mode_is_int(mymode) ||
+                                         /* SymConst: BB --> ref */
+                                         mode_is_reference(mymode))
+                                        ,"SymConst node", 0);
       break;
 
     case iro_Sel:
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       ASSERT_AND_RET_DBG(
-          /* Sel: BB x M x ref x int^n --> ref */
-          (op1mode == mode_M && op2mode == mymode && mode_is_reference(mymode)),
-      "Sel node", 0, show_node_failure(n)
-          );
+                                                /* Sel: BB x M x ref x int^n --> ref */
+                                                (op1mode == mode_M && op2mode == mymode && mode_is_reference(mymode)),
+                                                "Sel node", 0, show_node_failure(n)
+                                                );
       for (i=3; i < get_irn_arity(n); i++)
-      {
-        ASSERT_AND_RET_DBG(mode_is_int(get_irn_mode(in[i])), "Sel node", 0, show_node_failure(n));
-      }
+               {
+                 ASSERT_AND_RET_DBG(mode_is_int(get_irn_mode(in[i])), "Sel node", 0, show_node_failure(n));
+               }
       ent = get_Sel_entity(n);
       ASSERT_AND_RET_DBG(ent, "Sel node with empty entity", 0, show_node_failure(n));
       break;
@@ -715,18 +733,18 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
 
       if (get_method_variadicity(mt) == variadicity_variadic) {
         ASSERT_AND_RET_DBG(
-            get_Call_n_params(n) >= get_method_n_params(mt),
-            "Number of args for Call doesn't match number of args in variadic type.",
-            0,
-        fprintf(stderr, "Call has %d params, method %s type %d\n",
-          get_Call_n_params(n), get_type_name(mt), get_method_n_params(mt));
-        );
+                                                  get_Call_n_params(n) >= get_method_n_params(mt),
+                                                  "Number of args for Call doesn't match number of args in variadic type.",
+                                                  0,
+                                                  fprintf(stderr, "Call has %d params, method %s type %d\n",
+                                                                  get_Call_n_params(n), get_type_name(mt), get_method_n_params(mt));
+                                                  );
       }
       else {
         ASSERT_AND_RET(
-            get_Call_n_params(n) == get_method_n_params(mt),
-            "Number of args for Call doesn't match number of args in non variadic type.",
-            0);
+                                          get_Call_n_params(n) == get_method_n_params(mt),
+                                          "Number of args for Call doesn't match number of args in non variadic type.",
+                                          0);
       }
 
       for (i = 0; i < get_method_n_params(mt); i++) {
@@ -754,19 +772,19 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       ASSERT_AND_RET_DBG(
-          (
-           /* common Add: BB x numP x numP --> numP */
-       (op1mode == mymode && op2mode == op1mode && mode_is_numP(mymode)) ||
-           /* Pointer Add: BB x ref x int --> ref */
-           (mode_is_reference(op1mode) && mode_is_int(op2mode) && op1mode == mymode) ||
-           /* Pointer Add: BB x int x ref --> ref */
-           (mode_is_int(op1mode) && op2mode == mymode && mode_is_reference(mymode))
-      ),
-          "Add node", 0,
-      show_binop_failure(n, "/* common Add: BB x numP x numP --> numP */ |\n"
-                            "/* Pointer Add: BB x ref x int --> ref */   |\n"
-                                "/* Pointer Add: BB x int x ref --> ref */");
-          );
+                                                (
+                                                 /* common Add: BB x numP x numP --> numP */
+                                                 (op1mode == mymode && op2mode == op1mode && mode_is_numP(mymode)) ||
+                                                 /* Pointer Add: BB x ref x int --> ref */
+                                                 (mode_is_reference(op1mode) && mode_is_int(op2mode) && op1mode == mymode) ||
+                                                 /* Pointer Add: BB x int x ref --> ref */
+                                                 (mode_is_int(op1mode) && op2mode == mymode && mode_is_reference(mymode))
+                                                 ),
+                                                "Add node", 0,
+                                                show_binop_failure(n, "/* common Add: BB x numP x numP --> numP */ |\n"
+                                                                                       "/* Pointer Add: BB x ref x int --> ref */   |\n"
+                                                                                       "/* Pointer Add: BB x int x ref --> ref */");
+                                                );
       if (mode_is_reference(op1mode) != mode_is_reference(op2mode)) {
         /* BB x ref x int --> ref or BB x int x ref --> ref */
         op_is_symmetric = 0;
@@ -780,20 +798,20 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       ASSERT_AND_RET_DBG(
-          /* common Sub: BB x numP x numP --> numP */
-          ((mymode ==op1mode && mymode == op2mode && mode_is_numP(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 */" );
-          );
+                                                /* common Sub: BB x numP x numP --> numP */
+                                                ((mymode ==op1mode && mymode == op2mode && mode_is_numP(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 */" );
+                                                );
       if (mode_is_reference(op1mode) != mode_is_reference(op2mode)) {
         op_is_symmetric = 0;
       } else {
@@ -804,10 +822,10 @@ 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 && get_mode_sort(op1mode) == irms_float_number, "Minus node", 0,
-      show_unop_failure(n , "/* Minus: BB x float --> float */");
-          );
+                                                /* Minus: BB x float --> float */
+                                                op1mode == mymode && get_mode_sort(op1mode) == irms_float_number, "Minus node", 0,
+                                                show_unop_failure(n , "/* Minus: BB x float --> float */");
+                                                );
       op_is_symmetric = 2;
       break;
 
@@ -815,12 +833,12 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       ASSERT_AND_RET_DBG(
-          /* Mul: BB x int1 x int1 --> int2 */
-          ((mode_is_int(op1mode)   && op2mode == op1mode && mode_is_int(mymode)) ||
-       (mode_is_float(op1mode) && op2mode == op1mode && mymode == op1mode)),
-          "Mul node",0,
-      show_binop_failure(n, "/* Mul: BB x int1 x int1 --> int2 */");
-          );
+                                                /* Mul: BB x int1 x int1 --> int2 */
+                                                ((mode_is_int(op1mode)   && op2mode == op1mode && mode_is_int(mymode)) ||
+                                                 (mode_is_float(op1mode) && op2mode == op1mode && mymode == op1mode)),
+                                                "Mul node",0,
+                                                show_binop_failure(n, "/* Mul: BB x int1 x int1 --> int2 */");
+                                                );
       op_is_symmetric = 2;
       break;
 
@@ -829,13 +847,13 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op2mode = get_irn_mode(in[2]);
       op3mode = get_irn_mode(in[3]);
       ASSERT_AND_RET_DBG(
-          /* Quot: BB x M x float x float --> M x X x float */
-          op1mode == mode_M && op2mode == op3mode &&
-          get_mode_sort(op2mode) == irms_float_number &&
-          mymode == mode_T,
-          "Quot node",0,
-      show_binop_failure(n, "/* Quot: BB x M x float x float --> M x X x float */");
-          );
+                                                /* Quot: BB x M x float x float --> M x X x float */
+                                                op1mode == mode_M && op2mode == op3mode &&
+                                                get_mode_sort(op2mode) == irms_float_number &&
+                                                mymode == mode_T,
+                                                "Quot node",0,
+                                                show_binop_failure(n, "/* Quot: BB x M x float x float --> M x X x float */");
+                                                );
       op_is_symmetric = 2;
       break;
 
@@ -844,13 +862,13 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op2mode = get_irn_mode(in[2]);
       op3mode = get_irn_mode(in[3]);
       ASSERT_AND_RET(
-          /* DivMod: BB x M x int x int --> M x X x int x int */
-          op1mode == mode_M &&
-          mode_is_int(op2mode) &&
-          op3mode == op2mode &&
-          mymode == mode_T,
-          "DivMod node", 0
-          );
+                                        /* DivMod: BB x M x int x int --> M x X x int x int */
+                                        op1mode == mode_M &&
+                                        mode_is_int(op2mode) &&
+                                        op3mode == op2mode &&
+                                        mymode == mode_T,
+                                        "DivMod node", 0
+                                        );
       op_is_symmetric = 1;
       break;
 
@@ -860,25 +878,25 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op2mode = get_irn_mode(in[2]);
       op3mode = get_irn_mode(in[3]);
       ASSERT_AND_RET(
-          /* Div or Mod: BB x M x int x int --> M x X x int */
-          op1mode == mode_M &&
-          op2mode == op3mode &&
-          mode_is_int(op2mode) &&
-          mymode == mode_T,
-          "Div or Mod node", 0
-          );
+                                        /* Div or Mod: BB x M x int x int --> M x X x int */
+                                        op1mode == mode_M &&
+                                        op2mode == op3mode &&
+                                        mode_is_int(op2mode) &&
+                                        mymode == mode_T,
+                                        "Div or Mod node", 0
+                                        );
       op_is_symmetric = 1;
       break;
 
     case iro_Abs:
       op1mode = get_irn_mode(in[1]);
       ASSERT_AND_RET_DBG(
-    /* Abs: BB x num --> num */
-    op1mode == mymode &&
-    mode_is_num (op1mode),
-    "Abs node", 0,
-    show_unop_failure(n, "/* Abs: BB x num --> num */");
-      );
+                                                /* Abs: BB x num --> num */
+                                                op1mode == mymode &&
+                                                mode_is_num (op1mode),
+                                                "Abs node", 0,
+                                                show_unop_failure(n, "/* Abs: BB x num --> num */");
+                                                );
       op_is_symmetric = 2;
       break;
 
@@ -888,25 +906,25 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       ASSERT_AND_RET_DBG(
-    /* And or Or or Eor: BB x int x int --> int */
-    mode_is_int(mymode) &&
-    op2mode == op1mode &&
-    mymode == op2mode,
-    "And, Or or Eor node", 0,
-    show_binop_failure(n, "/* And or Or or Eor: BB x int x int --> int */");
-      );
+                                                /* And or Or or Eor: BB x int x int --> int */
+                                                mode_is_int(mymode) &&
+                                                op2mode == op1mode &&
+                                                mymode == op2mode,
+                                                "And, Or or Eor node", 0,
+                                                show_binop_failure(n, "/* And or Or or Eor: BB x int x int --> int */");
+                                                );
       op_is_symmetric = 2;
       break;
 
     case iro_Not:
       op1mode = get_irn_mode(in[1]);
       ASSERT_AND_RET_DBG(
-    /* Not: BB x int --> int */
-    mode_is_int(mymode) &&
-    mymode == op1mode,
-    "Not node", 0,
-    show_unop_failure(n, "/* Not: BB x int --> int */");
-      );
+                                                /* Not: BB x int --> int */
+                                                mode_is_int(mymode) &&
+                                                mymode == op1mode,
+                                                "Not node", 0,
+                                                show_unop_failure(n, "/* Not: BB x int --> int */");
+                                                );
       op_is_symmetric = 2;
       break;
 
@@ -915,13 +933,13 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       ASSERT_AND_RET_DBG(
-    /* Cmp: BB x datab x datab --> b16 */
-    mode_is_data (op1mode) &&
-    op2mode == op1mode &&
-    mymode == mode_T,
-    "Cmp node", 0,
-    show_binop_failure(n, "/* Cmp: BB x datab x datab --> b16 */");
-      );
+                                                /* Cmp: BB x datab x datab --> b16 */
+                                                mode_is_data (op1mode) &&
+                                                op2mode == op1mode &&
+                                                mymode == mode_T,
+                                                "Cmp node", 0,
+                                                show_binop_failure(n, "/* Cmp: BB x datab x datab --> b16 */");
+                                                );
       break;
 
     case iro_Shl:
@@ -930,47 +948,47 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       ASSERT_AND_RET_DBG(
-    /* Shl, Shr or Shrs: BB x int x int_u --> int */
-    mode_is_int(op1mode) &&
-    mode_is_int(op2mode) &&
-    !mode_is_signed(op2mode) &&
-    mymode == op1mode,
-    "Shl, Shr, Shr or Rot node", 0,
-    show_binop_failure(n, "/* Shl, Shr or Shrs: BB x int x int_u --> int */");
-      );
+                                                /* Shl, Shr or Shrs: BB x int x int_u --> int */
+                                                mode_is_int(op1mode) &&
+                                                mode_is_int(op2mode) &&
+                                                !mode_is_signed(op2mode) &&
+                                                mymode == op1mode,
+                                                "Shl, Shr, Shr or Rot node", 0,
+                                                show_binop_failure(n, "/* Shl, Shr or Shrs: BB x int x int_u --> int */");
+                                                );
       break;
 
     case iro_Rot:
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       ASSERT_AND_RET_DBG(
-    /* Rot: BB x int x int --> int */
-    mode_is_int(op1mode) &&
-    mode_is_int(op2mode) &&
-    mymode == op1mode,
-    "Rot node", 0,
-    show_binop_failure(n, "/* Rot: BB x int x int --> int */");
-      );
+                                                /* Rot: BB x int x int --> int */
+                                                mode_is_int(op1mode) &&
+                                                mode_is_int(op2mode) &&
+                                                mymode == op1mode,
+                                                "Rot node", 0,
+                                                show_binop_failure(n, "/* Rot: BB x int x int --> int */");
+                                                );
       break;
 
     case iro_Conv:
       op1mode = get_irn_mode(in[1]);
       ASSERT_AND_RET_DBG(
-    /* Conv: BB x datab1 --> datab2 */
-    mode_is_datab(op1mode) && mode_is_data(mymode),
-    "Conv node", 0,
-    show_unop_failure(n, "/* Conv: BB x datab1 --> datab2 */");
-      );
+                                                /* Conv: BB x datab1 --> datab2 */
+                                                mode_is_datab(op1mode) && mode_is_data(mymode),
+                                                "Conv node", 0,
+                                                show_unop_failure(n, "/* Conv: BB x datab1 --> datab2 */");
+                                                );
       break;
 
     case iro_Cast:
       op1mode = get_irn_mode(in[1]);
       ASSERT_AND_RET_DBG(
-    /* Conv: BB x datab1 --> datab2 */
-    mode_is_data(op1mode) && op1mode == mymode,
-    "Cast node", 0,
-    show_unop_failure(n, "/* Conv: BB x datab1 --> datab2 */");
-      );
+                                                /* Conv: BB x datab1 --> datab2 */
+                                                mode_is_data(op1mode) && op1mode == mymode,
+                                                "Cast node", 0,
+                                                show_unop_failure(n, "/* Conv: BB x datab1 --> datab2 */");
+                                                );
       break;
 
     case iro_Phi:
@@ -978,10 +996,10 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       for (i = 1; i < get_irn_arity(n); i++) {
         if (!is_Bad(in[i]) && (get_irn_op(in[i]) != op_Unknown))
           ASSERT_AND_RET_DBG(
-          get_irn_mode(in[i]) == mymode,
-          "Phi node", 0,
-          show_phi_failure(n, in[i], i);
-      );
+                                                        get_irn_mode(in[i]) == mymode,
+                                                        "Phi node", 0,
+                                                        show_phi_failure(n, in[i], i);
+                                                        );
       };
       ASSERT_AND_RET( mode_is_dataM(mymode), "Phi node", 0 );
       break;
@@ -990,11 +1008,27 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       ASSERT_AND_RET(
-          /* Load: BB x M x ref --> M x X x data */
-          op1mode == mode_M && mode_is_reference(op2mode),
-          "Load node", 0
-          );
+                                        /* Load: BB x M x ref --> M x X x data */
+                                        op1mode == mode_M && mode_is_reference(op2mode),
+                                        "Load node", 0
+                                        );
       ASSERT_AND_RET( mymode == mode_T, "Load node", 0 );
+
+         /*
+          * jack's gen_add_firm_code:simpleSel seems to build Load (Load
+          * (Proj (Proj))) sometimes ...
+
+          * interprete.c:ai_eval seems to assume that this happens, too
+
+          * obset.c:get_abstval_any can't deal with this if the load has
+          * mode_T
+          *
+         {
+               entity *ent = hunt_for_entity (get_Load_ptr (n), n);
+               assert ((NULL != ent) || (mymode != mode_T));
+         }
+         */
+
       break;
 
     case iro_Store:
@@ -1002,10 +1036,10 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op2mode = get_irn_mode(in[2]);
       op3mode = get_irn_mode(in[3]);
       ASSERT_AND_RET(
-          /* Load: BB x M x ref data --> M x X */
-          op1mode == mode_M && mode_is_reference(op2mode) && mode_is_data(op3mode),
-          "Store node", 0
-          );
+                                        /* Load: BB x M x ref data --> M x X */
+                                        op1mode == mode_M && mode_is_reference(op2mode) && mode_is_data(op3mode),
+                                        "Store node", 0
+                                        );
       ASSERT_AND_RET(mymode == mode_T, "Store node", 0);
       break;
 
@@ -1013,26 +1047,26 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       ASSERT_AND_RET_DBG(
-    /* Alloc: BB x M x int_u --> M x X x ref */
-    op1mode == mode_M &&
-    mode_is_int(op2mode) &&
-    !mode_is_signed(op2mode) &&
-    mymode == mode_T,
-    "Alloc node", 0,
-    show_binop_failure(n, "/* Alloc: BB x M x int_u --> M x X x ref */");
-      );
+                                                /* Alloc: BB x M x int_u --> M x X x ref */
+                                                op1mode == mode_M &&
+                                                mode_is_int(op2mode) &&
+                                                !mode_is_signed(op2mode) &&
+                                                mymode == mode_T,
+                                                "Alloc node", 0,
+                                                show_binop_failure(n, "/* Alloc: BB x M x int_u --> M x X x ref */");
+                                                );
       break;
 
     case iro_Free:
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       ASSERT_AND_RET_DBG(
-    /* Free: BB x M x ref --> M */
-    op1mode == mode_M && mode_is_reference(op2mode) &&
-    mymode == mode_M,
-    "Free node", 0,
-    show_binop_failure(n, "/* Free: BB x M x ref --> M */");
-      );
+                                                /* Free: BB x M x ref --> M */
+                                                op1mode == mode_M && mode_is_reference(op2mode) &&
+                                                mymode == mode_M,
+                                                "Free node", 0,
+                                                show_binop_failure(n, "/* Free: BB x M x ref --> M */");
+                                                );
       break;
 
     case iro_Sync:
@@ -1051,17 +1085,17 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       op1mode = get_irn_mode(in[1]);
       op2mode = get_irn_mode(in[2]);
       ASSERT_AND_RET_DBG(
-    /* Confirm: BB x T x T --> T */
-    op1mode == mymode &&
-    op2mode == mymode,
-    "Confirm node", 0,
-    show_binop_failure(n, "/* Confirm: BB x T x T --> T */");
-      );
+                                                /* Confirm: BB x T x T --> T */
+                                                op1mode == mymode &&
+                                                op2mode == mymode,
+                                                "Confirm node", 0,
+                                                show_binop_failure(n, "/* Confirm: BB x T x T --> T */");
+                                                );
       break;
 
     default:
       break;
-  }
+       }
 
   /* All went ok */
   return 1;