http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59429
--- Comment #11 from Kai Tietz <ktietz at gcc dot gnu.org> --- sure, I just shown the transformation for doing the sorting. After prioritizing the order we should transform back to initial condition and just changing comparison code plus the edges. To handle this we could use a table describing transformation rules. So we don't need to calculate anything. We have here one special-case to handle: '(a cmp1 b ? x : (a eq-neq b))' as this would be in the long form '(a cmp1 b ? (a eq-neq b ? 1 : 0))'