From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21645 invoked by alias); 29 Nov 2011 13:30:20 -0000 Received: (qmail 21622 invoked by uid 22791); 29 Nov 2011 13:30:17 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 29 Nov 2011 13:30:04 +0000 Received: from eggs.gnu.org ([140.186.70.92]:46115) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1RVNl3-0002Fb-D6 for gcc-help@gnu.org; Tue, 29 Nov 2011 08:30:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVNkx-0008Bx-6N for gcc-help@gnu.org; Tue, 29 Nov 2011 08:30:01 -0500 Received: from cantor2.suse.de ([195.135.220.15]:59484 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVNkw-0008Ap-VF; Tue, 29 Nov 2011 08:29:55 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id B0CC18738D; Tue, 29 Nov 2011 14:29:49 +0100 (CET) Date: Tue, 29 Nov 2011 14:55:00 -0000 From: Michael Matz To: Nadezhda =?koi8-r?Q?Ivan=CFvna?= Vyukova Cc: gcc@gnu.org, gcc-help@gnu.org Subject: Re: Gcc silently transforms a finite loop to an infinite one In-Reply-To: <1322566691.2994.43.camel@ab02> Message-ID: References: <1322566691.2994.43.camel@ab02> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="168427776-8647816-1322573387=:26507" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg00289.txt.bz2 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --168427776-8647816-1322573387=:26507 Content-Type: TEXT/PLAIN; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 881 Hi, please use gcc-help@ for this type of questions. On Tue, 29 Nov 2011, Nadezhda Ivan=D0=BEvna Vyukova wrote: > I've explained the customer that by default char is treated > as signed char on our platform and therefore this program=20 > does not conform ISO C90, as it causes the integer overflow > (undefined behavior). That is correct. > But he was not satisfied. > He argued that the program compiled with gcc-3.4.6 behaves=20 > "correctly" and now the compiler silently produces an=20 > incomprehensible code. There is no "correct" with undefined code. He simply was lucky with 3.4. > IMHO it would be better to issue a warning when a finite loop is=20 > transformed to an infinite one (as a result of -ftree-vrp). -Wstrict-overflow gives a warning in this program. This warning isn't=20 active by default. 4.1 didn't yet have this warning IIRC. Ciao, Michael.= --168427776-8647816-1322573387=:26507--