From: Richard Biener Date: Thu, 9 Mar 2023 09:56:57 +0000 (+0100) Subject: Avoid unnecessary epilogues from tree_unroll_loop X-Git-Tag: basepoints/gcc-15~10071 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01e79e21bbb2d10ecac784d383cefb88d2e20692;p=thirdparty%2Fgcc.git Avoid unnecessary epilogues from tree_unroll_loop The following fixes the condition determining whether we need an epilogue. * tree-ssa-loop-manip.cc (determine_exit_conditions): Fix no epilogue condition. --- diff --git a/gcc/tree-ssa-loop-manip.cc b/gcc/tree-ssa-loop-manip.cc index 09acc1c94cce..4ef27bae5152 100644 --- a/gcc/tree-ssa-loop-manip.cc +++ b/gcc/tree-ssa-loop-manip.cc @@ -1010,7 +1010,7 @@ determine_exit_conditions (class loop *loop, class tree_niter_desc *desc, /* Convert the latch count to an iteration count. */ tree niter = fold_build2 (PLUS_EXPR, type, desc->niter, build_one_cst (type)); - if (multiple_of_p (type, niter, bigstep)) + if (multiple_of_p (type, niter, build_int_cst (type, factor))) return; }