Bad and Unknown are pinned instructions yet, speeding up code placement
[libfirm] / ir / ir / irvrfy.c
index e8fe382..f8b2bed 100644 (file)
@@ -18,6 +18,7 @@
 # include "irgraph_t.h"
 # include "irvrfy.h"
 # include "irgwalk.h"
+# include "irdump.h"
 
 #ifdef NDEBUG
 /*
@@ -34,8 +35,9 @@
 #else
 #define ASSERT_AND_RET(expr, string, ret) \
 do { \
-  if (opt_do_node_verification == NODE_VERIFICATION_ON) \
-    assert((expr) && string); \
+  if (opt_do_node_verification == NODE_VERIFICATION_ON) {\
+    if (!(expr)) dump_ir_block_graph(current_ir_graph, "-assert"); \
+    assert((expr) && string); } \
   if (!(expr)) { \
     if (opt_do_node_verification == NODE_VERIFICATION_REPORT) \
       fprintf(stderr, #expr " : " string "\n"); \
@@ -667,22 +669,20 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
                      );
       break;
 
-  case iro_Const: {
-      tarval *tv = get_Const_tarval(n);
-         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. */
-                        );
-     } 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. */
+                    );
+      } 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()) {
-#if 0
+#if 1
          ASSERT_AND_RET((get_entity_peculiarity(ent) != peculiarity_description),
                         "A constant must address an existing method.", 0);
 #endif
@@ -822,7 +822,7 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg)
       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,
+                         op1mode == mymode && mode_is_float(op1mode), "Minus node", 0,
                          show_unop_failure(n , "/* Minus: BB x float --> float */");
                          );
       op_is_symmetric = 2;