From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12242 invoked by alias); 18 Feb 2015 16:28:31 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 12161 invoked by uid 48); 18 Feb 2015 16:28:28 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/64491] [5 Regression] incorrect warning: loop exit may only be reached after undefined behavior Date: Wed, 18 Feb 2015 16:28:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg02025.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64491 --- Comment #9 from Jakub Jelinek --- (In reply to Andrew Stubbs from comment #8) > Just silencing the warning may not be enough. The compiler may optimize away > loop exit conditions based on this analysis. The warning mirrors the logic > rather than shares it (due to the way the logic is distributed) so this may > not actually be a problem, in this case, but I'd have to look closer. Sure, it is desirable if the compiler optimizes away the loop exit test, it really is dead, because the loop will always be exit through the other loop exit earlier. But there is no user bug in there, so you shouldn't emit a false positive.