From: Jakub Jelinek Date: Tue, 19 Dec 2017 07:39:24 +0000 (+0100) Subject: re PR tree-optimization/80631 (Compiling with -O3 -mavx2 gives wrong code) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=497742efce59a3296461199c16bbc520154d0e2e;p=gcc.git re PR tree-optimization/80631 (Compiling with -O3 -mavx2 gives wrong code) PR tree-optimization/80631 * tree-vect-loop.c (vect_create_epilog_for_reduction): Compare induc_code against MAX_EXPR or MIN_EXPR instead of reduc_fn against IFN_REDUC_MAX or IFN_REDUC_MIN. From-SVN: r255804 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 96146e8934f..9f8b773d6b8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2017-12-19 Jakub Jelinek + + PR tree-optimization/80631 + * tree-vect-loop.c (vect_create_epilog_for_reduction): Compare + induc_code against MAX_EXPR or MIN_EXPR instead of reduc_fn against + IFN_REDUC_MAX or IFN_REDUC_MIN. + 2017-12-18 Jeff Law * tree-ssa-dom.c (record_equivalences_from_phis): Do not diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index a66c8cfccad..58e46a0f4d3 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -4432,9 +4432,9 @@ vect_create_epilog_for_reduction (vec vect_defs, gimple *stmt, && (STMT_VINFO_VEC_REDUCTION_TYPE (stmt_info) == INTEGER_INDUC_COND_REDUCTION) && !integer_zerop (induc_val) - && ((reduc_fn == IFN_REDUC_MAX + && ((induc_code == MAX_EXPR && tree_int_cst_lt (initial_def, induc_val)) - || (reduc_fn == IFN_REDUC_MIN + || (induc_code == MIN_EXPR && tree_int_cst_lt (induc_val, initial_def)))) induc_val = initial_def; vect_is_simple_use (initial_def, loop_vinfo, &def_stmt, &initial_def_dt);