From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 53A303836035; Thu, 12 Aug 2021 20:15:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53A303836035 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101830] [12 Regression] Incorrect error messages beginning with r12-2591 (backward jump threader) Date: Thu, 12 Aug 2021 20:15:32 +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, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED 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: resolution 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: Thu, 12 Aug 2021 20:15:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101830 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |FIXED --- Comment #12 from Martin Sebor --- No problem. By the way, it looks to me like safe_inc_pos() also isn't entirely safe sin= ce testing the result of the postincrement lets pos reach 1024 on function ret= urn. It should either use preincrement or 1023 as the bound. It's of course possible to issue a more nuanced warning ("may be out of bounds") for expressions that are invalid only under some condition, in bas= ic blocks that aren't dominated by function entry. It has been suggested (and considered) a number of times before. The problem with a simplistic soluti= on like that is that it would result in the vast majority of warnings being phrased this way, because most are in such blocks. The only certain warnin= gs would be either in trivial functions or in the initial basic blocks. I'm working on introducing this distinction for PHIs but I don't have any ideas what to do for problems like this one.=