From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EFCB73857810; Fri, 21 Jan 2022 16:16:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFCB73857810 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103121] [12 Regression] Warnings in cp/optimize.c causing build failure Date: Fri, 21 Jan 2022 16:16:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: build, diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned 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: Fri, 21 Jan 2022 16:16:53 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103121 --- Comment #29 from Martin Sebor --- >>From memory: At use1 the cache is empty so go and find its definition and record the offset at that point, with the pointer addition as the context. = And at use2 we look up the same offset. So use1 won't reflect the constant off= set. That could be both good (if the code is unreachable) and bad (if it is and= the use is invalid. If it did work the way you're concerned I'd expect to see a lot of mysterio= us false positives. The cache has been in use since GCC 11 and I don't recall coming across any puzzling problems. But we have seen an uptick in false positives in GCC 12 after we switched over to Ranger so let me double check= it really does work the way I say it does.=