https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104373
--- Comment #4 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:0f58ba4dd6b25b16d25494ae18d15dfa681f9b65 commit r12-7175-g0f58ba4dd6b25b16d25494ae18d15dfa681f9b65 Author: Richard Biener <rguent...@suse.de> Date: Fri Feb 4 09:46:43 2022 +0100 tree-optimization/104373 - early diagnostic on unreachable code The following improves early uninit diagnostics by computing edge reachability using VN and ignoring unreachable blocks when looking for uninitialized uses. To not ICE with -fdump-tree-all the early uninit pass needs a dumpfile since VN tries to dump statistics. 2022-02-04 Richard Biener <rguent...@suse.de> PR tree-optimization/104373 * tree-ssa-sccvn.h (do_rpo_vn): New export exposing the walk kind. * tree-ssa-sccvn.cc (do_rpo_vn): Export, get the default walk kind as argument. (run_rpo_vn): Adjust. (pass_fre::execute): Likewise. * tree-ssa-uninit.cc (warn_uninitialized_vars): Skip blocks not reachable. (execute_late_warn_uninitialized): Mark all edges as executable. (execute_early_warn_uninitialized): Use VN to compute executable edges. (pass_data_early_warn_uninitialized): Enable a dump file, change dump name to warn_uninit. * g++.dg/warn/Wuninitialized-32.C: New testcase. * gcc.dg/uninit-pr20644-O0.c: Remove XFAIL.