Hi, This patch fixes PR 49352 by ignoring debug uses in SLP reduction detection. While fixing it Jakub also discovered that an incorrect statement may be analyzed and operands of not commutative operation may be swapped. The patch fixes those as well. Bootstrapped and tested on powerpc64-suse-linux. Committed. Ira ChangeLog: 2011-06-13 Jakub Jelinek Ira Rosen PR tree-optimization/49352 * tree-vect-loop.c (vect_is_slp_reduction): Don't count debug uses at all, make sure loop_use_stmt after the loop is a def stmt of a used SSA_NAME that is the only one defined inside of the loop. Don't check for COND_EXPR and GIMPLE_BINARY_RHS. (vect_is_simple_reduction_1): Call vect_is_slp_reduction only if check_reduction is true. 2011-06-13 Jakub Jelinek Ira Rosen PR tree-optimization/49352 * gcc.dg/vect/pr49352.c: New test.