tree-optimization/111233 - loop splitting miscompile
commit2066c29bf8dea87c9810eb261e342d941a6b2059
authorRichard Biener <rguenther@suse.de>
Tue, 14 Nov 2023 13:26:17 +0000 (14 14:26 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 14 Nov 2023 14:10:16 +0000 (14 15:10 +0100)
tree34492059041d5693822be11a08626a4192d03d7e
parentbc390ae72ff974d6985639b5b392f6e9192c2ee7
tree-optimization/111233 - loop splitting miscompile

The change in r14-2852-gf5fb9ff2396fd4 failed to update patch_loop_exit
to compensate for rewriting of a NE/EQ_EXPR to a new code.  Fixed
with the following.

PR tree-optimization/111233
PR tree-optimization/111652
PR tree-optimization/111727
PR tree-optimization/111838
PR tree-optimization/112113
* tree-ssa-loop-split.cc (patch_loop_exit): Get the new
guard code instead of the old guard stmt.
(split_loop): Adjust.

* gcc.dg/torture/pr111233.c: New testcase.
* gcc.dg/torture/pr111652.c: Likewise.
* gcc.dg/torture/pr111727.c: Likewise.
* gcc.dg/torture/pr111838.c: Likewise.
* gcc.dg/torture/pr112113.c: Likewise.
gcc/testsuite/gcc.dg/torture/pr111233.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr111652.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr111727.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr111838.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/torture/pr112113.c [new file with mode: 0644]
gcc/tree-ssa-loop-split.cc