From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A22853858C27; Sat, 12 Mar 2022 09:39:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A22853858C27 From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104475] [12 Regression] Wstringop-overflow + atomics incorrect warning on dynamic object Date: Sat, 12 Mar 2022 09:39:21 +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: aldyh at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 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: Sat, 12 Mar 2022 09:39:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104475 Aldy Hernandez changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |law at gcc dot gnu.org --- Comment #8 from Aldy Hernandez --- (In reply to Richard Biener from comment #7) > I think we shouldn't do anything on the optimization side - sure, the path > isolation in the end turns out not profitable, but it's likely hard to de= cide > that. >=20 > Maybe we can somehow avoid threading for a ptr =3D=3D 0 condition? Why d= o we > make > the threading profitable? The threaders are mostly blind wrt threading a path. If they see it, they = will thread it. There are some minor things we disallow (see calls to cancel_th= read throughout) and the big hammer we introduced in this release with cancel_invalid_paths() where we disallow problematic loop transformations. = But mostly we thread everything that's possible. Disallowing ptr =3D=3D 0 as well as highly unlikely paths should be trivial= . We could add a simple check in cancel_invalid_paths(). Though, I assume that w= ould affect warning code all over, since we're reducing the amount of threadable paths on which they depend?=