From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CE57E385840C; Tue, 18 Jan 2022 09:00:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE57E385840C From: "dcb314 at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104082] Wdangling-pointer: 2 * false positive ? Date: Tue, 18 Jan 2022 09:00:33 +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: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: dcb314 at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: Tue, 18 Jan 2022 09:00:33 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104082 --- Comment #2 from David Binderman --- (In reply to Andrew Pinski from comment #1) > >I've no idea why the warning is generated, the code looks legal to me >=20 > The warning is generated even though the code is valid, if someone > deferences metricp after the call to s88, the code becomes undefined.=20 A warning for valid code is IMHO really bad. It would be a better warning if it only happened when the pointer is dereferenced. As is, I've got to find every occurrence of this warning and manually check for a problem. I think 90% of the time, it going to be legal code. > Why the warning is duplicated I have no idea. Righto.=