tree-optimization/112767 - spurious diagnostic after sccp/loop-split swap
commit2dde9f326ded84814a78c3044294b535c1f97b41
authorRichard Biener <rguenther@suse.de>
Thu, 30 Nov 2023 11:38:53 +0000 (30 12:38 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 30 Nov 2023 12:31:26 +0000 (30 13:31 +0100)
tree2c046a11b555c269b6aaa78c21693da4ba8761cc
parent8a6062a47b33da6d961c6354fd5788bc46aef0a9
tree-optimization/112767 - spurious diagnostic after sccp/loop-split swap

We are diagnosing an unreachable loop which we only manage to elide
after the copyprop pass after sccp which leaves the code open for
diagnosing by the intermittent ivcanon pass.  The following makes sure
to clean things up a bit earlier, propagating constant final values
to uses immediately.

PR tree-optimization/112767
* tree-scalar-evolution.cc (final_value_replacement_loop):
Propagate constants to immediate uses immediately.

* gcc.dg/tree-ssa/pr112767.c: New testcase.
* gcc.dg/graphite/pr83255.c: Disable SCCP.
gcc/testsuite/gcc.dg/graphite/pr83255.c
gcc/testsuite/gcc.dg/tree-ssa/pr112767.c [new file with mode: 0644]
gcc/tree-scalar-evolution.cc