diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-12-19 08:39:24 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-12-19 08:39:24 +0100 |
commit | 497742efce59a3296461199c16bbc520154d0e2e (patch) | |
tree | d6976d62c14a4bd27f40cf6ad77f52c3d023b2ce /gcc | |
parent | 6e02c507cc780dc0902c2cdabb22519c20c8145d (diff) | |
download | gcc-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')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/tree-vect-loop.c | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 96146e8..9f8b773 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 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); |