- use foreach_out_edge_safe in remove_copies
authorMatthias Braun <matze@braunis.de>
Wed, 31 May 2006 12:10:13 +0000 (12:10 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 31 May 2006 12:10:13 +0000 (12:10 +0000)
ir/be/bespillbelady.c
ir/be/beverify.c

index b0fb76d..bb08c2c 100644 (file)
@@ -589,20 +589,15 @@ static void remove_copies(belady_env_t *bel) {
        edges_activate(current_ir_graph);
        foreach_pset(bel->copies, irn) {
                ir_node *src;
-               const ir_edge_t *edge;
+               const ir_edge_t *edge, *ne;
 
                assert(be_is_Copy(irn));
 
                src = be_get_Copy_op(irn);
-               foreach_out_edge(irn, edge) {
+               foreach_out_edge_safe(irn, edge, ne) {
                        ir_node *user = get_edge_src_irn(edge);
                        int user_pos = get_edge_src_pos(edge);
 
-#if 0
-                       // is this normal?
-                       if(user == NULL)
-                               break;
-#endif
                        set_irn_n(user, user_pos, src);
                }
        }
index b75c545..e126418 100644 (file)
@@ -109,8 +109,8 @@ static void verify_schedule_walker(ir_node *bl, void *data)
        int delay_branches = 0;
 
        /*
-               Make sure that all phi nodes are scheduled at the beginning of the block, and that there
-               is 1 or no control flow changing node scheduled as last operation
+        * Make sure that all phi nodes are scheduled at the beginning of the block, and that there
+        * is 1 or no control flow changing node scheduled and exactly delay_branches operations after it.
         */
        sched_foreach(bl, irn) {
                if (is_Phi(irn)) {