From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7609 invoked by alias); 11 Apr 2009 12:52:00 -0000 Received: (qmail 7559 invoked by alias); 11 Apr 2009 12:51:47 -0000 Date: Sat, 11 Apr 2009 12:52:00 -0000 Message-ID: <20090411125147.7558.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/39736] signed overflow in loop induction variable: missing warning and wrong code In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "joseph at codesourcery dot com" 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: 2009-04/txt/msg01001.txt.bz2 ------- Comment #1 from joseph at codesourcery dot com 2009-04-11 12:51 ------- Subject: Re: New: signed overflow in loop induction variable: missing warning and wrong code On Sat, 11 Apr 2009, edwintorok at gmail dot com wrote: > Testcase: > #include > int > main () > { > int until = 40001; > short from = 0; > > for (; from < until; from++) > printf ("%d\n", from); > > return 0; > } There is no undefined behavior here (increment of a short value converts to int, increments then converts back to short, none of which are undefined), so at least the wrong code issue would be the same as bug 35634. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39736