]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/120729 - limit compile time in uninit_analysis::prune_phi_opnds
authorRichard Biener <rguenther@suse.de>
Fri, 20 Jun 2025 13:07:20 +0000 (15:07 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 23 Jun 2025 08:34:43 +0000 (10:34 +0200)
commit97044a47de533f2a9b3fc864e5ea318e53979079
treed4c1e69c4459be57706e7917ab9672c7762af5ce
parent8130a2ad91ca8571b099ba020443fadab7a688ca
tree-optimization/120729 - limit compile time in uninit_analysis::prune_phi_opnds

The testcase in this PR shows, on the GCC 14 branch, that in some
degenerate cases we can spend exponential time pruning always
initialized paths through a web of PHIs.  The following adds
--param uninit-max-prune-work, defaulted to 100000, to limit that
to effectively O(1).

PR tree-optimization/120729
* gimple-predicate-analysis.h (uninit_analysis::prune_phi_opnds):
Add argument of work budget remaining.
* gimple-predicate-analysis.cc (uninit_analysis::prune_phi_opnds):
Likewise.  Maintain and honor it throughout the recursion.
* params.opt (uninit-max-prune-work): New.
* doc/invoke.texi (uninit-max-prune-work): Document.
gcc/doc/invoke.texi
gcc/gimple-predicate-analysis.cc
gcc/gimple-predicate-analysis.h
gcc/params.opt