bugfix
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Thu, 21 Jul 2005 19:20:35 +0000 (19:20 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Thu, 21 Jul 2005 19:20:35 +0000 (19:20 +0000)
[r6263]

ir/tr/tr_inheritance.c

index 64f82af..2d4a157 100644 (file)
@@ -636,14 +636,26 @@ void verify_irn_class_cast_state(ir_node *n, void *env) {
   if (is_subclass_of(totype, fromtype) ||
       is_subclass_of(fromtype, totype)   ) {
     this_state = ir_class_casts_transitive;
-    if ((get_class_supertype_index(totype, fromtype) == -1) &&
-        (get_class_supertype_index(fromtype, totype) == -1) ) {
+    if ((get_class_supertype_index(totype, fromtype) != -1) ||
+       (get_class_supertype_index(fromtype, totype) != -1) ||
+       fromtype == totype) {
+      /*   Das ist doch alt?  Aus dem cvs aufgetaucht ...
+          if ((get_class_supertype_index(totype, fromtype) == -1) &&
+          (get_class_supertype_index(fromtype, totype) == -1) ) {  */
       this_state = ir_class_casts_normalized;
     }
   }
 
-  assert(this_state >= ccs->expected_state &&
-        "invalid state class cast state setting in graph");
+  if (!(this_state >= ccs->expected_state)) {
+    printf("  Node is "); DDMN(n);
+    printf("    totype   "); DDMT(totype);
+    printf("    fromtype "); DDMT(fromtype);
+    printf("    this_state: %s, exp. state: %s\n",
+          get_class_cast_state_string(this_state),
+          get_class_cast_state_string(ccs->expected_state));
+    assert(this_state >= ccs->expected_state &&
+          "invalid state class cast state setting in graph");
+  }
 
   if (this_state < ccs->worst_situation)
     ccs->worst_situation = this_state;