http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45685
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-24 15:27:41 UTC --- I guess it would be helpful if some tree pass figured out that computing cond_expr is usually quite expensive, and that instead of computing 4 different cond_exprs (always one in wider type, one in narrower type and one with ? -1 : 1 and one with ? 1 : -1 for the same condition) it is more efficient to compute it just once (in wider mode) and then negate and/or cast to narrower mode to get the other needed results.