From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 443 invoked by alias); 13 Apr 2009 07:53:49 -0000 Received: (qmail 425 invoked by uid 48); 13 Apr 2009 07:53:39 -0000 Date: Mon, 13 Apr 2009 07:53:00 -0000 Message-ID: <20090413075339.424.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: "schwab at linux-m68k dot org" 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/msg01078.txt.bz2 ------- Comment #6 from schwab at linux-m68k dot org 2009-04-13 07:53 ------- (In reply to comment #4) > But your test program does cause signed overflow No, it doesn't. There is a conversion (from int to short) where the value is not representable by the target type, but that is _not_ undefined, but rather implementation-defined, and GCC has chosen to define the conversion as modulo operation. There is no room for GCC to behave differently. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39736