From: Uncle George <gatgul@voicenet.com>
To: axp-list@redhat.com
Subject: Re: gcc 2.96 optimization bug on RedHat7.0/alpha
Date: Wed, 18 Apr 2001 20:28:51 -0400 [thread overview]
Message-ID: <3ADE3143.E8F86D97@voicenet.com> (raw)
In-Reply-To: 20010418153340.A28974@ellpspace.math.ualberta.ca
[-- Attachment #1: Type: text/plain, Size: 1919 bytes --]
Michal Jaegermann wrote:
> 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.
What happens after is also irrelevant, as there is no point on continuing
with the routine if steps 1-4 of the equation dont happen. i ascribe no
particular meaning to either I0, or I1. Just need to realize that the results
are different between optimizations.
>
>
> > 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.
>
I hope that pointer arith is well defined. and should yield the same results
with -O0 -O1 -O2 and so on.
>
> > 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.
>
yup, ergo the majic statement to disassemble the double to 2 ints is a macro.
But again, irrelevant to talk about the various other architectures. I have
only posted a CPP'd snippet of the problem code to demonstrate the erroneous
results, as per gnu c bug reporting info.
Whats a pointer pun?
/gat
[-- Attachment #2: Type: text/html, Size: 2337 bytes --]
next prev parent reply other threads:[~2001-04-19 0:28 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
2001-04-18 23:09 ` P.TURLAIS
2001-04-19 0:28 ` Uncle George [this message]
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