]> git.ipfire.org Git - people/ms/gcc.git/commit
tree-optimization/108793 - niter compute type mismatch
authorRichard Biener <rguenther@suse.de>
Mon, 20 Feb 2023 11:58:50 +0000 (12:58 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 15 Mar 2023 09:07:57 +0000 (10:07 +0100)
commit0a3642dde799ee2be9f2b60ec361191176390005
tree2fc55742ecf85ec80c2eae47d3802dc8fb21508c
parent21e7145aaf582c263e69a3ee05dfa9d42bdbd1aa
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.

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