Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
To: axp-list@redhat.com
Subject: Re: gcc 2.96 optimization bug on RedHat7.0/alpha
Date: Wed, 18 Apr 2001 15:33:40 -0600	[thread overview]
Message-ID: <20010418153340.A28974@ellpspace.math.ualberta.ca> (raw)
In-Reply-To: <3ADE12A4.777D7877@voicenet.com>; from gatgul@voicenet.com on Wed, Apr 18, 2001 at 06:18:13PM -0400

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




  parent reply	other threads:[~2001-04-18 21:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-18  1:46 gcc 2.96 optimization bug on RedHat7.0/alpha Uncle George
2001-04-18  0:04 ` Christopher C. Chimelis
2001-04-18  3:41 ` Matt Wilson
2001-04-18  4:32 ` Brad Lucier
2001-04-18 15:13   ` Uncle George
2001-04-18 13:40     ` Pawel Salek
2001-04-18 15:53       ` Uncle George
2001-04-18 14:03     ` David Woodhouse
2001-04-18 17:10       ` Uncle George
2001-04-18 15:40         ` Pawel Salek
2001-04-18 16:17         ` David Woodhouse
2001-04-18 16:46         ` Andrew A. Gill
2001-04-18 17:04           ` T. Daniel Crawford
2001-04-18 18:15             ` Nelson Brito
2001-04-18 18:38         ` jeff.sturm
2001-04-18 14:55     ` Michal Jaegermann
2001-04-18 22:18       ` Uncle George
2001-04-18 20:50         ` Chris Eleveld (Sector 7 Group)
2001-04-18 21:33         ` Michal Jaegermann [this message]
2001-04-18 23:09           ` P.TURLAIS
2001-04-19  0:28           ` Uncle George
2001-04-18 22:03         ` jeff.sturm
  -- strict thread matches above, loose matches on Subject: below --
2001-04-18 16:22 Hoover, Tony
2001-04-18 16:55 ` David Woodhouse
2001-04-18 17:07 ` alvin
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox