]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/106809 - compile time hog in VN
authorRichard Biener <rguenther@suse.de>
Fri, 2 Sep 2022 11:36:13 +0000 (13:36 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 9 Sep 2022 09:49:39 +0000 (11:49 +0200)
commite08dd36f90e74cd5be615b1ca82a38896434d48c
treec025d67af949d29ec9d0761544075cbb72d7ace1
parent98fed14662b12bc3fcff15ef29a006aa7898ce5d
tree-optimization/106809 - compile time hog in VN

The dominated_by_p_w_unex function is prone to high compile time.
With GCC 12 we introduced a VN run for uninit diagnostics which now
runs into a degenerate case with bison generated code.  Fortunately
this case is easy to fix with a simple extra check - a more
general fix needs more work.

PR tree-optimization/106809
* tree-ssa-sccvn.cc (dominaged_by_p_w_unex): Check we have
more than one successor before doing extra work.

* gcc.dg/torture/pr106809.c: New testcase.

(cherry picked from commit be1b42de9c151d46c89f9a8f82d4c5839a19ea94)
gcc/testsuite/gcc.dg/torture/pr106809.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.cc