From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7791 invoked by alias); 12 Mar 2002 20:06: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 7751 invoked by uid 71); 12 Mar 2002 20:06:01 -0000 Resent-Date: 12 Mar 2002 20:06:01 -0000 Resent-Message-ID: <20020312200601.7750.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, gbv@oxixares.com Received:(qmail 4038 invoked from network); 12 Mar 2002 20:03:40 -0000 Received: from unknown (HELO mozart.oxixares.com) (217.127.2.161) by sources.redhat.com with SMTP; 12 Mar 2002 20:03:40 -0000 Received: (from gbv@localhost) by mozart.oxixares.com (8.11.0/8.11.0/SuSE Linux 8.11.0-0.4) id g2CK3Jf01400; Tue, 12 Mar 2002 21:03:19 +0100 Message-Id:<200203122003.g2CK3Jf01400@mozart.oxixares.com> Date: Tue, 12 Mar 2002 12:06:00 -0000 From: gbv@oxixares.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:3.113 Subject: c/5926: gcc 3.0.3 generates incorrect code with -O3 option X-SW-Source: 2002-03/txt/msg00394.txt.bz2 List-Id: >Number: 5926 >Category: c >Synopsis: gcc 3.0.3 generates incorrect code with -O3 option >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Tue Mar 12 12:06:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Guillermo Ballester Valor >Release: 3.0.3 >Organization: >Environment: System: Linux mozart 2.2.19 #2 Sat Jun 2 21:32:31 CEST 2001 i586 unknown Architecture: i586 host: i586-pc-linux-gnu build: i586-pc-linux-gnu target: i586-pc-linux-gnu configured with: ./configure >Description: I've detected a problem when updated from gcc 2.95.2 . A result was different depending on the order of a line of code were written, without aparent cause, when using -O3 >How-To-Repeat: See the problem compiling the following code with -O3 option. The two routines are the same but a code of line changed. I think both results would be the same but I get different resuts. ----------------------------------- #include #include #include size_t last_nsize=0; #define BITS_PER_LIMB 32 unsigned long Y_MASQ,Y_LIMB,Y_MAX,Y_BITS; double Y_TINV; int bugy_routine(size_t n1, size_t n2) { size_t n,nsize,needed=0,i; nsize= n1 + n2; /*See whether all the initialization work con be avoided */ needed=(nsize*BITS_PER_LIMB); Y_BITS = (unsigned long)((double)24.00 - 0.5*log((double)needed)); Y_MASQ=((1U<Fix: I don't know >Release-Note: >Audit-Trail: >Unformatted: