https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105646

--- Comment #3 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:a1cd4d52d6ef90b977fb2d80c1cf17f3efa5b01d

commit r13-2926-ga1cd4d52d6ef90b977fb2d80c1cf17f3efa5b01d
Author: Richard Biener <rguent...@suse.de>
Date:   Fri Aug 19 15:11:14 2022 +0200

    tree-optimization/105646 - re-interpret always executed in uninit diag

    The following fixes PR105646, not diagnosing

    int f1();
    int f3(){
        auto const & a = f1();
        bool v3{v3};
        return a;
    }

    with optimization because the early uninit diagnostic pass only
    diagnoses always executed cases.  The patch does this by
    re-interpreting what always executed means and choosing to
    ignore exceptional and abnormal control flow for this.  At the
    same time it improves things as suggested in a comment - when
    the value-numbering run done without optimizing figures there's
    a fallthru path, consider blocks on it as always executed.

            PR tree-optimization/105646
            * tree-ssa-uninit.cc (warn_uninitialized_vars): Pre-compute
            the set of fallthru reachable blocks from function entry
            and use that to determine wlims.always_executed.

            * g++.dg/uninit-pr105646.C: New testcase.

Reply via email to