Update the type of control.base after changed
authorJiufu Guo <guojiufu@linux.ibm.com>
Fri, 21 Jan 2022 09:03:50 +0000 (17:03 +0800)
committerguojiufu <guojiufu@linux.ibm.com>
Mon, 24 Jan 2022 09:07:16 +0000 (17:07 +0800)
commit634de54f9c421b7069865d0d7365ad97412f34bd
treed398f1d6b4825e4e11aec55ffa722846d230422d
parentadd6bb52e34f6036ace9f67ad8ad5b990adbc34a
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.
gcc/testsuite/gcc.dg/pr102087_1.c [new file with mode: 0644]
gcc/tree-ssa-loop-niter.cc