Do not mark the transformed as visited. It makes no sense at all.
[libfirm] / ir / be / bearch.c
index 88c8482..da4d020 100644 (file)
@@ -33,7 +33,6 @@
 #include "benode_t.h"
 #include "ircons_t.h"
 #include "irnode_t.h"
-#include "xmalloc.h"
 
 #include "bitset.h"
 #include "pset.h"
@@ -52,15 +51,15 @@ arch_env_t *arch_env_init(const arch_isa_if_t *isa_if, FILE *file_handle, be_mai
 /**
  * Put all registers in a class into a bitset.
  * @param cls The class.
- * @param bs The bitset. May be NULL.
+ * @param bs The bitset.
  * @return The number of registers in the class.
  */
 static int arch_register_class_put(const arch_register_class_t *cls, bitset_t *bs)
 {
-       int i, n;
-       for(i = 0, n = cls->n_regs; i < n; ++i)
+       int i, n = cls->n_regs;
+       for (i = n - 1; i >= 0; --i)
                bitset_set(bs, i);
-       return cls->n_regs;
+       return n;
 }
 
 /**