tree-optimization/111917 - bougs IL after guard hoisting
commitd96bd4aade170fcd86f5f09b68b770dde798e631
authorRichard Biener <rguenther@suse.de>
Mon, 23 Oct 2023 09:25:17 +0000 (23 11:25 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 23 Oct 2023 10:32:00 +0000 (23 12:32 +0200)
tree7c279d74aa1be4649df8b1bcf93af9b2a22a4cd7
parent0c4bd1321a6def5eb44c530e83b01a415633b660
tree-optimization/111917 - bougs IL after guard hoisting

The unswitching code to hoist guards inserts conditions in wrong
places.  The following fixes this, simplifying code.

PR tree-optimization/111917
* tree-ssa-loop-unswitch.cc (hoist_guard): Always insert
new conditional after last stmt.

* gcc.dg/torture/pr111917.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr111917.c [new file with mode: 0644]
gcc/tree-ssa-loop-unswitch.cc