From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16419 invoked by alias); 26 Feb 2013 17:54:22 -0000 Received: (qmail 16285 invoked by uid 48); 26 Feb 2013 17:53:45 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/56463] infinite loop when having integer overflow in a simple accumulator Date: Tue, 26 Feb 2013 17:54:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2013-02/txt/msg02531.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56463 --- Comment #3 from Jakub Jelinek 2013-02-26 17:53:43 UTC --- The compiler may assume that undefined behavior doesn't happen in the program. It is fine to have undefined behavior in code that will be never executed, but as soon as you hit it, the program can do anything.