https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108793
--- Comment #4 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:a7e706df2280de4a42f68b6c44401e4348d3593c commit r13-6258-ga7e706df2280de4a42f68b6c44401e4348d3593c Author: Richard Biener <rguent...@suse.de> Date: Mon Feb 20 12:58:50 2023 +0100 tree-optimization/108793 - niter compute type mismatch When computing the number of iterations until wrap types are mixed up, eventually leading to checking ICEs with a pointer bitwise inversion. The following uses niter_type for the calculation. PR tree-optimization/108793 * tree-ssa-loop-niter.cc (number_of_iterations_until_wrap): Use convert operands to niter_type when computing num. * gcc.dg/torture/pr108793.c: New testcase.