From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CCD43385782C; Wed, 27 Apr 2022 10:03:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCD43385782C From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/104492] [12 Regression] Bogus dangling pointer warning at -O3 Date: Wed, 27 Apr 2022 10:03:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: diagnostic, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: msebor at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2022 10:03:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104492 --- Comment #10 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:9aaaae7edb781867797d0a553a7db99d52ecd5e1 commit r12-8282-g9aaaae7edb781867797d0a553a7db99d52ecd5e1 Author: Richard Biener 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) !=3D 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 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.=