]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/122537 - do not elide maybe_zero condition for wrapping IV
authorRichard Biener <rguenther@suse.de>
Thu, 29 Jan 2026 12:56:11 +0000 (13:56 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 29 Jan 2026 14:17:06 +0000 (15:17 +0100)
commit06320fa8b37593f00ebc13b37d6411eb29ff8a4c
treeaf53a0b3d41f5b8113067f6b01e2ce043a592071
parent397b0827bcd40eb9b0c5c4bfae7a3dcb2030cef2
tree-optimization/122537 - do not elide maybe_zero condition for wrapping IV

The following removes the optimization eliding the maybe_zero condition
from number_of_iterations_lt_to_ne when the IV can overflow since the
IV delta input is not accurately reflecting this.

PR tree-optimization/122537
* tree-ssa-loop-niter.cc (number_of_iterations_lt_to_ne): Register
may_be_zero condition when the IV may overflow.

* gcc.dg/torture/pr122537.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr122537.c [new file with mode: 0644]
gcc/tree-ssa-loop-niter.cc