]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/117574 - bougs niter lt-to-ne
authorRichard Biener <rguenther@suse.de>
Fri, 15 Nov 2024 10:56:14 +0000 (11:56 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 4 Apr 2025 10:09:50 +0000 (12:09 +0200)
commit8eeaaec278275db2be81792c833713f64c9d20eb
tree5f3e2fdcb803b9b0bf46aac82da917ed90bb8b37
parent5509544dad81adc21c2e6d9782b0ef1390aa4f7c
tree-optimization/117574 - bougs niter lt-to-ne

When trying to change a IV from IV0 < IV1 to IV0' != IV1' we apply
fancy adjustments to the may_be_zero condition we compute rather
than using the obvious IV0->base >= IV1->base expression (to be
able to use > instead of >=?).  This doesn't seem to go well.

PR tree-optimization/117574
* tree-ssa-loop-niter.cc (number_of_iterations_lt_to_ne):
Use the obvious may_be_zero condition.

* gcc.dg/torture/pr117574-1.c: New testcase.

(cherry picked from commit ff5a14abeb31cd6bd0ca55e7043d05c8141a8c7f)
gcc/testsuite/gcc.dg/torture/pr117574-1.c [new file with mode: 0644]
gcc/tree-ssa-loop-niter.cc