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 45D1C2F19E for ; Wed, 18 Apr 2001 09:21:57 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f3IDIY410143 for axp-list@listman.redhat.com; Wed, 18 Apr 2001 09:18:34 -0400 Received: from smtp6ve.mailsrvcs.net (smtp6vepub.gte.net [206.46.170.27]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f3IDIYC10138 for ; Wed, 18 Apr 2001 09:18:34 -0400 Received: from voicenet.com (adsl-141-155-118-169.nyc.adsl.bellatlantic.net [141.155.118.169]) by smtp6ve.mailsrvcs.net (8.9.1/8.9.1) with ESMTP id NAA12514826; Wed, 18 Apr 2001 13:25:48 GMT Message-ID: <3ADDAF37.18D256A1@voicenet.com> Date: Wed, 18 Apr 2001 11:13:59 -0400 From: Uncle George X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.17-4 alpha) X-Accept-Language: en MIME-Version: 1.0 To: axp-list@redhat.com Cc: gcc-bugs@gcc.gnu.org Subject: Re: gcc 2.96 optimization bug on RedHat7.0/alpha References: <200104180432.XAA03440@zakon.math.purdue.edu> 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: Any compiler that does not produce the correct code has a bug - baring any error messages. I suppose one has to deceide if an error message should be produced OR proper code should be produced. Its not terribly reasonable to have the defectively generated code around for some poor user to fall over upon. AND I dont want to spend another day trying to figure out which one of the newly installed Redhat 6.2/7.0, gcc, glib's were at fault in producing the wrong results ( for what ever reason ) /gat BTW did I say thanks for the insight ? It looks like a strange subject to get into, and a fairly dangerous one if not taken into consideration. Its something I would not have considered at all. Hummmm. Brad Lucier wrote: > > > > 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 > > _______________________________________________ > Axp-list mailing list > Axp-list@redhat.com > https://listman.redhat.com/mailman/listinfo/axp-list