Do not mark the transformed as visited. It makes no sense at all.
[libfirm] / ir / be / bespillbelady3.c
index 3c6711e..5d90cc4 100644 (file)
@@ -53,7 +53,9 @@
 #include "besched_t.h"
 #include "be_t.h"
 
+#ifndef NDEBUG
 #define EXPENSIVE_CHECKS
+#endif
 
 DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
 
@@ -84,7 +86,7 @@ typedef struct worklist_t worklist_t;
 struct worklist_t {
        struct list_head  live_values;
        size_t            n_live_values;
-       unsigned long     visited;
+       ir_visited_t      visited;
 };
 
 typedef struct block_info_t block_info_t;
@@ -103,7 +105,7 @@ static bool                         tentative_mode;
 static bool                         should_have_reached_fixpoint;
 static bool                         do_push_unused_livethroughs;
 static ir_exec_freq                *exec_freq;
-static unsigned long                worklist_visited;
+static ir_visited_t                 worklist_visited;
 
 static worklist_t *new_worklist(void)
 {
@@ -197,7 +199,7 @@ static void fill_and_activate_worklist(worklist_t *new_worklist,
                                continue;
                }
 
-               if (irn_visited(value))
+               if (irn_visited_else_mark(value))
                        continue;
 
                new_entry = obstack_alloc(&obst, sizeof(new_entry[0]));
@@ -213,7 +215,6 @@ static void fill_and_activate_worklist(worklist_t *new_worklist,
                list_add_tail(&new_entry->head, &new_worklist->live_values);
                ++n_live_values;
 
-               mark_irn_visited(value);
                set_irn_link(value, new_entry);
                new_worklist->n_live_values++;
        }
@@ -681,7 +682,10 @@ static void find_in_loop(ir_loop *loop, ir_node *entry)
                }
                assert(found);
        }
+#else
+       (void) entry;
 #endif
+
        /* check all loop successors */
        for (edge = loop_info->exit_edges; edge != NULL; edge = edge->next) {
                ir_node *succ      = edge->block;