From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D18A338DFB45; Tue, 6 Dec 2022 10:26:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D18A338DFB45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670322390; bh=lJ9kM1bfwf2H+TZs4AIL052tq2X8n0LexQqKcralEZU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QaLK8QwkynZX9TnuIWZ9UuWonPjvAMqwSwix9xjsgZX8Yy54LMbxsg9aWNZRatBqn XUU/DJlUGfTPZRho4S3dMYTTlHquxEf1klXPY79gnNVIiTJHpyW2bAMvcKUitBmlRZ zKqTW5ONBayp0kXBm+fuzMFsUdLLwqijVyxe3yEU= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104475] [12/13 Regression] Wstringop-overflow + atomics incorrect warning on dynamic object Date: Tue, 06 Dec 2022 10:26:29 +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, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: 12.3 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104475 --- Comment #18 from Richard Biener --- The change improved the wording of the diagnostic by appending the note indicating an object at zero address. It didn't mitigate the diagnostic wh= ich as far as I analyzed is technically correct (but not very helpful). An improvement for these diagnostics would be analyzer-style reporting of the guarding conditions. Another possible improvement would be to somehow keep a pointer to the symbolic base we equality-propagated from the conditional so that we, for if (!d) if (enabled) *d =3D 0; can say the object pointed-to by 'd' when 'd' is nullptr is accessed here. The IL currently just has a pointer constant and doesn't know that was originally derived from 'd'.=