+ /*
+ * Note: it is crucial for the monotony that the Proj(Cond)
+ * are evaluates after all predecessors of the Cond selector are
+ * processed.
+ * Example
+ *
+ * if (x != 0)
+ *
+ * Due to the fact that 0 is a const, the Cmp gets immediately
+ * on the cprop list. It will be evaluated before x is evaluated,
+ * might leaving x as Top. When later x is evaluated, the Cmp
+ * might change its value.
+ * BUT if the Cond is evaluated before this happens, Proj(Cond, FALSE)
+ * gets R, and later changed to F if Cmp is evaluated to True!
+ *
+ * We prevent this by putting Conds in an extra cprop_X queue, which
+ * gets evaluated after the cprop queue is empty.
+ *
+ * Note that this even happens with Click's original algorithm, if
+ * Cmp(x, 0) is evaluated to True first and later changed to False
+ * if x was Top first and later changed to a Const ...
+ * It is unclear how Click solved that problem ...
+ *
+ * However, in rare cases even this does not help, if a Top reaches
+ * a compare through a Phi, than Proj(Cond) is evaluated changing
+ * the type of the Phi to something other.
+ * So, we take the last resort and bind the type to R once
+ * it is calculated.
+ *
+ * (This might be even the way Click works around the whole problem).
+ *
+ * Finally, we may miss some optimization possibilities due to this:
+ *
+ * x = phi(Top, y)
+ * if (x == 0)
+ *
+ * If Top reaches the if first, than we decide for != here.
+ * If y later is evaluated to 0, we cannot revert this decision
+ * and must live with both outputs enabled. If this happens,
+ * we get an unresolved if (true) in the code ...
+ *
+ * In Click's version where this decision is done at the Cmp,
+ * the Cmp is NOT optimized away than (if y evaluated to 1
+ * for instance) and we get a if (1 == 0) here ...
+ *
+ * Both solutions are suboptimal.
+ * At least, we could easily detect this problem and run
+ * cf_opt() (or even combo) again :-(
+ */
+ if (node->type.tv == tarval_reachable)
+ return;
+
+ if (pnc == pn_Cond_true) {
+ if (selector->type.tv == tarval_b_false) {
+ node->type.tv = tarval_unreachable;
+ } else if (selector->type.tv == tarval_b_true) {
+ node->type.tv = tarval_reachable;
+ } else if (selector->type.tv == tarval_bottom) {
+ node->type.tv = tarval_reachable;
+ } else {
+ assert(selector->type.tv == tarval_top);
+ if (tarval_UNKNOWN == tarval_top) {
+ /* any condition based on Top is "!=" */