From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B550B3858415; Wed, 9 Mar 2022 13:36:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B550B3858415 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103724] [9/10/11/12 Regression] invalid warning: iteration 7 invokes undefined behavior Date: Wed, 09 Mar 2022 13:36:37 +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: 11.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: 9.5 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: Wed, 09 Mar 2022 13:36:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103724 --- Comment #6 from Richard Biener --- (In reply to Frank Heckenbach from comment #5) > (In reply to Richard Biener from comment #4) > > One thing we could do is annotate struct loop * with the (high level) > > optimizations we've applied so that when we emit this warning we could = say > >=20 > > note: this loop is the copy generated by loop unswitching where b =3D= =3D 0 > >=20 > > or so. Or maybe at least show > >=20 > > note: this loop was unswitched >=20 > If this is meant to apply to user-visible warnings, I'm not sure I'd like > it. I usually run with -Werror, and this would still be a warning turned > error then, wouldn't it? Yes. It might provide you with hints how to work around things though, like do if (c) since b must be !=3D 0. That said, I don't think we can reasonably do something on the GCC side her= e.=