From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23699 invoked by alias); 20 Aug 2002 17:16:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 23654 invoked by uid 71); 20 Aug 2002 17:16:01 -0000 Resent-Date: 20 Aug 2002 17:16:01 -0000 Resent-Message-ID: <20020820171601.23653.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Thomas Deselaers Received: (qmail 22803 invoked from network); 20 Aug 2002 17:11:29 -0000 Received: from unknown (HELO bigboss.hitnet.rwth-aachen.de) (137.226.181.2) by sources.redhat.com with SMTP; 20 Aug 2002 17:11:29 -0000 Received: from racker.hitnet.rwth-aachen.de ([137.226.181.65] helo=racker) by bigboss.hitnet.rwth-aachen.de with esmtp (Exim 3.35 #1 (Debian)) id 17hCXQ-0001WG-00; Tue, 20 Aug 2002 19:11:28 +0200 Received: from thomasd by racker with local (Exim 3.35 #1 (Debian)) id 17hCXO-0002ml-00; Tue, 20 Aug 2002 19:11:26 +0200 Message-Id: Date: Tue, 20 Aug 2002 10:16:00 -0000 From: Thomas Deselaers To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org X-Send-Pr-Version: 3.113 Subject: c/7661: gcc-3.0 optimization bug on debian GNULinux on x86 with very simple program X-SW-Source: 2002-08/txt/msg00414.txt.bz2 List-Id: >Number: 7661 >Category: c >Synopsis: gcc-3.0 optimization bug on debian GNU/Linux on x86 with very simple program >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Tue Aug 20 10:16:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Thomas Deselaers >Release: 3.0.4 (Debian testing/unstable) >Organization: >Environment: System: Linux racker 2.4.19 #3 Tue Aug 6 23:01:23 CEST 2002 i686 unknown unknown GNU/Linux Architecture: i686 Dell Inspiron 8200, Pentium 4 mobile 1600 OS: Linux 2.4.19 unpatched host: i386-pc-linux-gnu build: i386-pc-linux-gnu target: i386-pc-linux-gnu configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux >Description: OK, while playing around(together with Stefan Jacobs, he wanted to be mentioned) I found out, that this small programm: -------file:maxint.cc------------ main() { int i=0; int oldi=0;; while(++i>oldi) oldi=i; return oldi; } --------------------------------- does work absolutely fine, when compiled without any optimization, but does not terminate at all, when using any optimization-options: with "gcc -o maxint maxint.cc" the maxint-program works fine, but with "gcc -o maxint maxint.cc -O$X" with $X being nothing, or one of the numbers from 1 to 9, the maxint program does not terminate. >How-To-Repeat: copy the code-excerpt to a file and compile it >Fix: Workaround: not use -O$X >Release-Note: >Audit-Trail: >Unformatted: