+#define pu_color_irn(pu,irn,col,ob) _pu_color_irn(pu, irn, col, irn, ob)
+
+/**
+ * Tries to set as much members of a phi unit as possible to color @p col.
+ * All changes taken together are guaranteed to be conflict free.
+ */
+static int pu_try_color(phi_unit_t *pu, int col, int b_size) {
+ struct obstack ob_mis, ob_undo;
+ int i, redo, mis_size;
+ ir_node **mis;
+
+ /* first init pessimistically. Just return if we can't get a better result */
+ mis_size = 0;
+
+ obstack_init(&ob_mis);
+ obstack_init(&ob_undo);
+ redo = 1;
+ while (redo) {
+ redo = 0;
+ /* get a max independent set regarding current conflicts */
+ mis_size = pu_get_max_ind_set(pu, &ob_mis);
+ mis = obstack_finish(&ob_mis);
+
+ /* shortcut: if mis size is worse than best, then mis won't be better. */
+ if (mis_size < b_size)
+ goto ret;
+
+ /* check if its possible to set the color for all members of the maximum set*/
+ for (i = 0; i < mis_size; ++i) {
+ ir_node *test_node, *confl_node;
+
+ test_node = mis[i];
+ DBG((dbgphi, 1, "\t\t Testing %n\n", test_node));
+ confl_node = pu_color_irn(pu, test_node, col, &ob_undo);
+
+ if (confl_node == CHANGE_SAVE) {
+ if (!pset_find_ptr(free_nodes, test_node))
+ pu_pin_node(pu, test_node);
+ obstack_free(&ob_undo, obstack_finish(&ob_undo));