https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104519
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:d8b6da8dd15240849e00d46f3aef40cb8eeb1dc5 commit r12-7239-gd8b6da8dd15240849e00d46f3aef40cb8eeb1dc5 Author: Richard Biener <rguent...@suse.de> Date: Tue Feb 15 09:40:59 2022 +0100 tree-optimization/104519 - adjust PR100499 niter fix The following adjusts the PR100499 niter fix to use the appropriate types when checking whether the difference between the final and base values of the IV are a multiple of the step. It also gets rid of an always false condition in multiple_of_p which lead me to a wrong solution first. 2022-02-15 Richard Biener <rguent...@suse.de> PR tree-optimization/104519 * fold-const.cc (multiple_of_p): Remove never true condition. * tree-ssa-loop-niter.cc (number_of_iterations_ne): Use the appropriate types for determining whether the difference of final and base is a multiple of the step. * gcc.dg/torture/pr104519.c: New testcase.