From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id 633C62EFF5 for ; Wed, 18 Apr 2001 00:35:17 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f3I4Vs308222 for axp-list@listman.redhat.com; Wed, 18 Apr 2001 00:31:54 -0400 Received: from newton.math.purdue.edu (root@newton.math.purdue.edu [128.210.3.6]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f3I4VrC08218 for ; Wed, 18 Apr 2001 00:31:53 -0400 Received: from zakon.math.purdue.edu (IDENT:root@zakon.math.purdue.edu [128.210.3.23]) by newton.math.purdue.edu (8.10.1/8.10.1/PURDUE_MATH-4.0) with ESMTP id f3I4Z2L15764; Tue, 17 Apr 2001 23:35:02 -0500 (EST) Received: (from lucier@localhost) by zakon.math.purdue.edu (8.9.3/8.9.3/PURDUE_MATH-3.2) id XAA03440; Tue, 17 Apr 2001 23:32:42 -0500 From: Brad Lucier Message-Id: <200104180432.XAA03440@zakon.math.purdue.edu> Subject: Re: gcc 2.96 optimization bug on RedHat7.0/alpha To: axp-list@redhat.com Date: Tue, 17 Apr 2001 23:32:42 -0500 (EST) Cc: gcc-bugs@gcc.gnu.org In-Reply-To: <3ADCF1E0.66BCA4AB@voicenet.com> from "Uncle George" at Apr 17, 2001 09:46:08 PM X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: > > with -O2 i get the wrong answer > > [gat@LX gat]$ gcc -g -O2 a.c -o a > [gat@LX gat]$ ./a > FlooR: x = 22.16, i0=1, i1=536871996 > > > with -O i get a passable answer > > [gat@LX gat]$ gcc -g -O a.c -o a > [gat@LX gat]$ ./a > FlooR: x = 22.16, i0=1077291253, i1=-1030792151 In ISO C, the compiler can assume that the address of a real is not the same as the address of an int, and gcc does so unless you give the -fno-strict-aliasing flag: popov-9% gcc -v Reading specs from /export/u10/egcs-test/lib/gcc-lib/alphaev6-unknown-linux-gnu/3.1/specs Configured with: ../configure --prefix=/export/u10/egcs-test --enable-checking=no --enable-shared=no gcc version 3.1 20010415 (experimental) popov-10% gcc -O2 -o a a.c popov-11% ./a FlooR: x = 22.16, i0=1, i1=536871788 popov-12% gcc -O2 -fno-strict-aliasing -o a a.c popov-13% ./a FlooR: x = 22.16, i0=1077291253, i1=-1030792151 So it may not be a bug. Brad