]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/111917 - bougs IL after guard hoisting
authorRichard Biener <rguenther@suse.de>
Mon, 23 Oct 2023 09:25:17 +0000 (11:25 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 27 Nov 2023 11:52:27 +0000 (12:52 +0100)
commitbbd68241f7277850ba9f97c3d26c968f365f5479
tree1cb4d2f1d14b8baa1d2508b8ece784554ce88081
parent2cc700fec5c72d9c1385ec83621771bb9db58d96
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.

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