https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102087
--- Comment #23 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jiu Fu Guo <guoji...@gcc.gnu.org>: https://gcc.gnu.org/g:634de54f9c421b7069865d0d7365ad97412f34bd commit r12-6834-g634de54f9c421b7069865d0d7365ad97412f34bd Author: Jiufu Guo <guoji...@linux.ibm.com> Date: Fri Jan 21 17:03:50 2022 +0800 Update the type of control.base after changed This patch correct the type of niter->control.base, when it is updated as a PLUS expr. During build PLUS expr, the result type should align with the type of the operands. PR tree-optimization/102087 gcc/ChangeLog: * tree-ssa-loop-niter.cc (number_of_iterations_until_wrap): Correct PLUS result type. gcc/testsuite/ChangeLog: * gcc.dg/pr102087_1.c: New test.