aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-12-19 08:39:24 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-12-19 08:39:24 +0100
commit497742efce59a3296461199c16bbc520154d0e2e (patch)
treed6976d62c14a4bd27f40cf6ad77f52c3d023b2ce /gcc/tree-vect-loop.c
parent6e02c507cc780dc0902c2cdabb22519c20c8145d (diff)
downloadgcc-497742efce59a3296461199c16bbc520154d0e2e.zip
gcc-497742efce59a3296461199c16bbc520154d0e2e.tar.gz
gcc-497742efce59a3296461199c16bbc520154d0e2e.tar.bz2
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
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index a66c8cf..58e46a0 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -4432,9 +4432,9 @@ vect_create_epilog_for_reduction (vec<tree> 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);