]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/120003 - missed jump threading
authorRichard Biener <rguenther@suse.de>
Wed, 30 Apr 2025 09:52:17 +0000 (11:52 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 6 Jun 2025 07:52:37 +0000 (09:52 +0200)
commit4d375ebd56c54dc8c242bed988f29094b7e3e94e
tree5d0618811dadc313916d95d87337697047271b62
parent8fb3d9066266ea30de62c395239bda4e992297a3
tree-optimization/120003 - missed jump threading

The following allows the entry and exit block of a jump thread path
to be equal, which can easily happen when there isn't a forwarder
on the interesting edge for an FSM thread conditional.  We just
don't want to enlarge the path from such a block.

PR tree-optimization/120003
* tree-ssa-threadbackward.cc (back_threader::find_paths_to_names):
Allow block re-use but do not enlarge the path beyond such a
re-use.

* gcc.dg/tree-ssa/ssa-thread-23.c: New testcase.
* gcc.dg/tree-ssa/ssa-dom-thread-7.c: Adjust.

(cherry picked from commit 1a13684dfc7286139064f7d7341462c9995cbd1c)
gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-23.c [new file with mode: 0644]
gcc/tree-ssa-threadbackward.cc