+
+#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);
+ arch_register_req_t req;
+ ir_node *curr;
+ int free_col;
+
+ /* Get all possible colors */
+ arch_put_non_ignore_regs(arch_env, cls, free_cols);
+
+ /* Exclude colors not assignable to the irn */
+ arch_get_register_req(arch_env, &req, irn, -1);
+ if (arch_register_req_is(&req, limited)) {
+ bitset_t *limited = bitset_alloca(cls->n_regs);
+ req.limited(req.limited_env, 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 */