+
+ req = arch_get_irn_register_req(irn);
+#ifdef SEARCH_FREE_COLORS
+ /* If we resolve conflicts (recursive calls) we can use any unused color.
+ * In case of the first call @p col must be used.
+ */
+ if (irn != trigger) {
+ bitset_t *free_cols = bitset_alloca(cls->n_regs);
+ ir_node *curr;
+ int free_col;
+
+ /* Get all possible colors */
+ bitset_copy(free_cols, co->cenv->allocatable_regs);
+
+ /* Exclude colors not assignable to the irn */
+ if (arch_register_req_is(req, limited)) {
+ bitset_t *limited = bitset_alloca(cls->n_regs);
+ rbitset_copy_to_bitset(req->limited, limited);
+ bitset_and(free_cols, limited);
+ }
+
+ /* Exclude the color of the irn, because it must _change_ its color */
+ bitset_clear(free_cols, irn_col);
+
+ /* Exclude all colors used by adjacent nodes */
+ be_ifg_foreach_neighbour(ifg, &iter, irn, curr)
+ bitset_clear(free_cols, qnode_get_new_color(qn, curr));
+
+ free_col = bitset_next_set(free_cols, 0);
+
+ if (free_col != -1) {
+ qnode_set_new_color(qn, irn, free_col);
+ return CHANGE_SAVE;
+ }
+ }
+#endif /* SEARCH_FREE_COLORS */
+
+ /* If target color is not allocatable changing color is impossible */
+ if (!arch_reg_is_allocatable(req, arch_register_for_index(cls, col))) {