]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/112859 - bogus loop distribution
authorRichard Biener <rguenther@suse.de>
Thu, 23 Jan 2025 12:10:17 +0000 (13:10 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 24 Feb 2025 08:05:24 +0000 (09:05 +0100)
commit2456fd2c73df1839f645f36b09d3b33aea1883d3
tree33246f600f8364528c8813ea0660160df66d95ab
parentfd386b345a0406dc4f67173db76fdaca089b5675
tree-optimization/112859 - bogus loop distribution

When we get a zero distance vector we still have to check for the
situation of a common inner loop with zero distance.  But we can
still allow a zero distance for the loop we distribute
(gcc.dg/tree-ssa/ldist-33.c is such a case).  This is because
zero distances in non-outermost loops are a misrepresentation
of dependence by dependence analysis.

Note that test coverage of loop distribution of loop nests is
very low.

PR tree-optimization/112859
PR tree-optimization/115347
* tree-loop-distribution.cc
(loop_distribution::pg_add_dependence_edges): For a zero
distance vector still make sure to not have an inner
loop with zero distance.

* gcc.dg/torture/pr112859.c: New testcase.
* gcc.dg/torture/pr115347.c: Likewise.

(cherry picked from commit 04ba1300407f106a6dd10d346f58a51d87e6d43e)
gcc/testsuite/gcc.dg/torture/pr112859.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr115347.c [new file with mode: 0644]
gcc/tree-loop-distribution.cc