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

--- 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:9aaaae7edb781867797d0a553a7db99d52ecd5e1

commit r12-8282-g9aaaae7edb781867797d0a553a7db99d52ecd5e1
Author: Richard Biener <rguent...@suse.de>
Date:   Mon Apr 25 10:46:16 2022 +0200

    middle-end/104492 - avoid all equality compare dangling pointer diags

    The following extends the equality compare dangling pointer diagnostics
    suppression for uses following free or realloc to also cover those
    following invalidation of auto variables via CLOBBERs.  That avoids
    diagnosing idioms like

      return std::find(std::begin(candidates), std::end(candidates), s)
               != std::end(candidates);

    for auto candidates which are prone to forwarding of the final
    comparison across the storage invalidation as then seen by the
    late run access warning pass.

    2022-04-25  Richard Biener  <rguent...@suse.de>

            PR middle-end/104492
            * gimple-ssa-warn-access.cc
            (pass_waccess::warn_invalid_pointer): Exclude equality compare
            diagnostics for all kind of invalidations.
            (pass_waccess::check_dangling_uses): Fix post-dominator query.
            (pass_waccess::check_pointer_uses): Likewise.

Reply via email to