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 2D9452EFD4 for ; Wed, 18 Apr 2001 17:33:56 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id f3ILUY015420 for axp-list@listman.redhat.com; Wed, 18 Apr 2001 17:30:34 -0400 Received: from ellpspace.math.ualberta.ca (IDENT:michal@ellpspace.math.ualberta.ca [129.128.207.67]) by mail.redhat.com (8.11.0/8.8.7) with ESMTP id f3ILUWC15416 for ; Wed, 18 Apr 2001 17:30:33 -0400 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.9.3/8.9.3) id PAA28997 for axp-list@redhat.com; Wed, 18 Apr 2001 15:33:40 -0600 Date: Wed, 18 Apr 2001 15:33:40 -0600 From: Michal Jaegermann To: axp-list@redhat.com Subject: Re: gcc 2.96 optimization bug on RedHat7.0/alpha Message-ID: <20010418153340.A28974@ellpspace.math.ualberta.ca> References: <200104180432.XAA03440@zakon.math.purdue.edu> <3ADDAF37.18D256A1@voicenet.com> <20010418085548.A28346@ellpspace.math.ualberta.ca> <3ADE12A4.777D7877@voicenet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3ADE12A4.777D7877@voicenet.com>; from gatgul@voicenet.com on Wed, Apr 18, 2001 at 06:18:13PM -0400 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: On Wed, Apr 18, 2001 at 06:18:13PM -0400, Uncle George wrote: > Its not my code segment, and from my experience a union might be better. > although from this discourse not safe either. > > the code as stated should: > 1) take address of x > 2) make into int ptr > 3) add 1 to ptr ( value of 4 bec its an int ptr ) > 4) fetch integer from the address as calculated. Well, yes, you translated the code from C to English. But the question really was what you expect that it will happen after these operations and what kind of a _meaning_ you ascribe to that. > It should not matter if at x there is 8 bytes of a double, as that > distinction is superflous to the equation. But if you think that some consistent results should come from this program then you assume that such "pointer puns" have a well defined semantics. I do not recall that they ever had. > anyway the segment was taken from a floor() function (akin to glibc: > ./sysdeps/ieee754/dbl-64/s_floor.c). This may even work for some particular platform and some particular compiler, so it may be ok in internals of libraries, but it does not mean that it can be copied elsewhere. Michal