https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106754
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:0a4a2667dc115ca73b552fcabf8570620dfbe55f commit r13-2500-g0a4a2667dc115ca73b552fcabf8570620dfbe55f Author: Richard Biener <rguent...@suse.de> Date: Tue Sep 6 13:46:00 2022 +0200 tree-optimization/106754 - fix compute_control_dep_chain defect The following handles the situation of a loop exit along the control path to the PHI def or from there to the use in a different way, aoviding premature abort of the walks as noticed in the two cases where the exit is outermost (gcc.dg/uninit-pred-11.c) or wrapped in a condition that is on the path (gcc.dg/uninit-pred-12.c). Instead of handling such exits during recursion we now pick them up in the parent when walking post-dominators. That requires an additional post-dominator walk at the outermost level which is facilitated by splitting out the walk to a helper function and the existing wrapper added earlier. The patch also removes the bogus early exit from uninit_analysis::init_use_preds, fixing a simplified version of the PR106155 testcase. PR tree-optimization/106754 * gimple-predicate-analysis.cc (compute_control_dep_chain_pdom): New function, split out from compute_control_dep_chain. Handle loop-exit like conditions here by pushing to the control vector. (compute_control_dep_chain): Adjust and streamline dumping. In the wrapper perform a post-dominator walk as well. (uninit_analysis::init_use_preds): Remove premature early exit. * gcc.dg/uninit-pred-12.c: New testcase. * gcc.dg/uninit-pr106155-1.c: Likewise.