From: Richard Biener Date: Tue, 25 Jul 2017 10:59:15 +0000 (+0000) Subject: re PR tree-optimization/81303 (410.bwaves regression caused by r249919) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fdd293743d43c5721e75d951d57d73b50af6738d;p=gcc.git re PR tree-optimization/81303 (410.bwaves regression caused by r249919) 2017-07-25 Richard Biener PR tree-optimization/81303 * tree-vect-loop-manip.c (vect_loop_versioning): Build profitability check against LOOP_VINFO_NITERSM1. From-SVN: r250503 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 42697c510a9..82c7edc595d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-07-25 Richard Biener + + PR tree-optimization/81303 + * tree-vect-loop-manip.c (vect_loop_versioning): Build + profitability check against LOOP_VINFO_NITERSM1. + 2017-07-25 Alexander Monakov * domwalk.c (cmp_bb_postorder): Simplify. diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c index b76b515a788..97080a61ff7 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -2136,7 +2136,7 @@ vect_loop_versioning (loop_vec_info loop_vinfo, tree arg; profile_probability prob = profile_probability::likely (); gimple_seq gimplify_stmt_list = NULL; - tree scalar_loop_iters = LOOP_VINFO_NITERS (loop_vinfo); + tree scalar_loop_iters = LOOP_VINFO_NITERSM1 (loop_vinfo); bool version_align = LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT (loop_vinfo); bool version_alias = LOOP_REQUIRES_VERSIONING_FOR_ALIAS (loop_vinfo); bool version_niter = LOOP_REQUIRES_VERSIONING_FOR_NITERS (loop_vinfo); @@ -2144,7 +2144,7 @@ vect_loop_versioning (loop_vec_info loop_vinfo, if (check_profitability) cond_expr = fold_build2 (GE_EXPR, boolean_type_node, scalar_loop_iters, build_int_cst (TREE_TYPE (scalar_loop_iters), - th)); + th - 1)); if (version_niter) vect_create_cond_for_niters_checks (loop_vinfo, &cond_expr);