http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49352
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-06-10 11:44:03 UTC --- Created attachment 24486 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24486 gcc47-pr49352.patch Rough patch I've been playing with. There is no point testing gimple_code of use_stmt if it is GIMPLE_PHI, because phi is known to be a PHI. The patch attempts to only allow exactly one loop use stmt and use that stmt. I had to drop the use_stmt != first_stmt test, otherwise the transformation wouldn't ever happen, not sure if you want to allow in that case another loop use (if yes, which one of the two do you want as loop_use_stmt?). I also wonder if vect_is_slp_reduction should just return false; early if code is COND_EXPR, if for COND_EXPR def1 is not equal to phi I'm afraid it could be called.