re PR tree-optimization/80631 (Compiling with -O3 -mavx2 gives wrong code)
authorJakub Jelinek <jakub@redhat.com>
Tue, 19 Dec 2017 07:39:24 +0000 (08:39 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 19 Dec 2017 07:39:24 +0000 (08:39 +0100)
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

gcc/ChangeLog
gcc/tree-vect-loop.c

index 96146e8934f54e21552ed8cb98979d241b6630bf..9f8b773d6b829b8560c7ca8aeb5b1c64a34cce09 100644 (file)
@@ -1,3 +1,10 @@
+2017-12-19  Jakub Jelinek  <jakub@redhat.com>
+
+       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  <law@redhat.com>
 
        * tree-ssa-dom.c (record_equivalences_from_phis): Do not
index a66c8cfccad3c010aaa9be804a0ce4b7fb62ec8d..58e46a0f4d30d9bdf3f92e8c32eef8d8c028f693 100644 (file)
@@ -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);