https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80631
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Fri Dec 15 22:12:46 2017 New Revision: 255726 URL: https://gcc.gnu.org/viewcvs?rev=255726&root=gcc&view=rev Log: Backported from mainline 2017-12-12 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/80631 * tree-vect-loop.c (get_initial_def_for_reduction): Fix comment typo. (vect_create_epilog_for_reduction): Add INDUC_VAL argument, for INTEGER_INDUC_COND_REDUCTION use INDUC_VAL instead of hardcoding zero as the value if COND_EXPR is never true. For INTEGER_INDUC_COND_REDUCTION don't emit the final COND_EXPR if INDUC_VAL is equal to INITIAL_DEF. (vectorizable_reduction): Compute INDUC_VAL for vect_create_epilog_for_reduction, if no value is suitable, don't use INTEGER_INDUC_COND_REDUCTION for now. Formatting fixes. * gcc.dg/vect/pr80631-1.c: New test. * gcc.dg/vect/pr80631-2.c: New test. PR tree-optimization/80631 * gcc.target/i386/avx2-pr80631.c: New test. Added: branches/gcc-7-branch/gcc/testsuite/gcc.dg/vect/pr80631-1.c branches/gcc-7-branch/gcc/testsuite/gcc.dg/vect/pr80631-2.c branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/avx2-pr80631.c Modified: branches/gcc-7-branch/gcc/ChangeLog branches/gcc-7-branch/gcc/testsuite/ChangeLog branches/gcc-7-branch/gcc/tree-vect-loop.c