bugfix and additional case for optimization.
authorGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Sun, 22 May 2005 15:17:35 +0000 (15:17 +0000)
committerGötz Lindenmaier <goetz@ipd.info.uni-karlsruhe.de>
Sun, 22 May 2005 15:17:35 +0000 (15:17 +0000)
May we skip casts when checking for exception after alloc?  I think so.

[r5868]

ir/opt/ldstopt.c

index 663ff5f..5bf3c94 100644 (file)
@@ -381,7 +381,8 @@ static int optimize_load(ir_node *load)
         }
       }
     }
-    else if (get_irn_op(ptr) == op_Alloc) {
+    else if ((get_irn_op(skip_Proj(ptr)) == op_Alloc) ||
+            ((get_irn_op(ptr) == op_Cast) && (get_irn_op(skip_Proj(get_Cast_op(ptr))) == op_Alloc))) {
       /* simple case: a direct load after an Alloc. Firm Alloc throw
        * an exception in case of out-of-memory. So, there is no way for an
        * exception in this load.