From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 19A253858C54; Tue, 26 Apr 2022 14:12:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19A253858C54 From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/105346] [11/12 Regression] -Wno-free-nonheap-object false positive (on Bison-generated grammar code) Date: Tue, 26 Apr 2022 14:12:01 +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: 11.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: aldyh at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Tue, 26 Apr 2022 14:12:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105346 Aldy Hernandez changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aldyh at gcc dot gnu.org --- Comment #12 from Aldy Hernandez --- (In reply to Andrew Macleod from comment #11) > - The relation oracle currently only works with ssa-names. > - Ranger also doesn't currently track that sort of symbolic equivalence w= ith > irange. > - the VRP passes have a pointer tracking mechanism as part of the dom wal= k, > and the call to rvrp_folder::value_of_expr (bufp_2) would give us &buf. I > also think we also would fold the stmt in VRP. This could in theory be > extended to any pass doing a dom walk. however: > - I believe the upcoming prange extension for pointer ranges in stage 1 w= ill > make this happen naturally with rangers query system. range_of_stmt ( if > <..>) would then produce bool [0, 0]. I would also expect that prange wi= ll > have an easy way to ask what its base/equivalence(s) are. Yeah, ranger itself doesn't deal with MEM_REF's and the like. We work arou= nd this in evrp by using the pointer_equiv_analyzer class which tracks pointer equality in a DOM walk. But this is only used by the evrp pass (not the threader or any other ranger client). prange should indeed take care of this. It tracks pointer equality, POINTER_PLUS_EXPR, POINTER_DIFF_EXPR, etc. As you say, range_of_stmt shoul= d be able to trivially fold the conditional. For that matter, the pointer query code could probably all be replaced with prange, instead of the ad-hoc pointer tracking it does.=