http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56695
--- Comment #6 from Marc Glisse <glisse at gcc dot gnu.org> 2013-03-26 16:03:04 UTC --- Created attachment 29733 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29733 Untested patch I was thinking about something like this. In 4.8, I added vec_cond_expr expansion when the condition is not a comparison but a signed integer. I didn't notice that the vectorizer was generating comparisons with an unsigned result. In 4.9 I added some folding of vec_cond_expr, which ended up folding the comparison to a constant (still unsigned) and now cannot be expanded. What I do in the patch is make the vectorizer generate a signed result. An alternative would be to change the decision that vec_cond_expr expects a signed first argument. Note as well that we reach expand with a vec_cond_expr with 3 constant arguments, so there is a missed optimization there.