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

--- Comment #10 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:0a07bfad12530bca5dc5188057ad910198780dbc

commit r13-6707-g0a07bfad12530bca5dc5188057ad910198780dbc
Author: Richard Biener <rguent...@suse.de>
Date:   Wed Mar 15 09:12:33 2023 +0100

    tree-optimization/109123 - run -Wuse-afer-free only early

    The following switches the -Wuse-after-free diagnostics from emitted
    during the late access warning passes to the early access warning
    passes to make sure we run before passes performing code motion run
    which are the source of a lot of false positives on use-after-free
    not involving memory operations.

    The patch also fixes an issue in c-c++-common/Wuse-after-free-6.c
    and causes the name of the unused pointer to appear in the diagnostic
    for extra cases in gcc.dg/Wuse-after-free-2.c

            PR tree-optimization/109123
            * gimple-ssa-warn-access.cc (pass_waccess::warn_invalid_pointer):
            Do not emit -Wuse-after-free late.
            (pass_waccess::check_call): Always check call pointer uses.

            * gcc.dg/Wuse-after-free-pr109123.c: New testcase.
            * gcc.dg/Wuse-after-free-2.c: Amend expected diagnostic with
            the name of the pointer.
            * c-c++-common/Wuse-after-free-6.c: Un-XFAIL case.

Reply via email to