We can't allow vectorization of widneing reduction patterns like DOT_PROD and WIDEN_SUM when their results are used in the loop. This is because these idioms compute N widened results and then reduce them into N/2 results by summing-up pairs of results. So if we need to use (say store) the original N results we cannot use this idiom. (In innermost-loop vectorization this cannot happen because a reduction cannot be used in the loop. However, in outer-loop vectorization, a reduction in the inner-loop can be used in the outer-loop). Bootstrapped with vectorization enabled and tested on the vectorizer testcases on powerpc64-linux. Committed to autovect branch. dorit * tree-vect-analyze.c (vect_mark_relevant): Don't mark widening reduction patterns as relevant if they are used in the outer-loop (we want to vectorize the original sequence instead). (vect_mark_stmts_to_be_vectorized): Add an assert. * tree-vect-transform.c (vect_finalize_reduction): Set a stmt_info. * gcc.dg/vect/vect-outer-4e.c: New test. * gcc.dg/vect/vect-outer-4f.c: New test. * gcc.dg/vect/vect-outer-4g.c: New test. * gcc.dg/vect/no-section-anchors-vect-outer-4h.c: New test. * gcc.dg/vect/vect-outer-4i.c: New test. * gcc.dg/vect/vect-outer-4j.c: New test. * gcc.dg/vect/vect-outer-4k.c: New test. * gcc.dg/vect/vect-outer-4l.c: New test. * gcc.dg/vect/vect-outer-4m.c: New test. (See attached file: autovectfix.txt)