tree-optimization/106722 - uninit analysis with long def -> use path
authorRichard Biener <rguenther@suse.de>
Tue, 23 Aug 2022 11:58:31 +0000 (13:58 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 23 Aug 2022 13:20:27 +0000 (15:20 +0200)
commitbaa3ffb19c54fa334ac2884f6acb5d31aa79ac32
treee80aaddb11403cd82cba20563f4ce099557b5278
parentb25c5d6133d356a34aee72a24fd4cdec5637cc17
tree-optimization/106722 - uninit analysis with long def -> use path

The following applies similar measures as r13-2133-ge66cf626c72d58
to the computation of the use predicate when the path from PHI def
to use is too long and we run into compute_control_dep_chain limits.

It also moves the preprocessor define limits internal.

This resolves the reduced testcase but not the original one.

PR tree-optimization/106722
* gimple-predicate-analysis.h (MAX_NUM_CHAINS, MAX_CHAIN_LEN,
MAX_POSTDOM_CHECK, MAX_SWITCH_CASES): Move ...
* gimple-predicate-analysis.cc: ... here and document.
(simple_control_dep_chain): New function, factored from
predicate::use_cannot_happen.
(predicate::use_cannot_happen): Adjust.
(predicate::predicate): Use simple_control_dep_chain as fallback.

* g++.dg/uninit-pr106722-1.C: New testcase.
gcc/gimple-predicate-analysis.cc
gcc/gimple-predicate-analysis.h
gcc/testsuite/g++.dg/uninit-pr106722-1.C [new file with mode: 0644]