From: abel@bfr.co.il (Alexander L. Belikoff)
To: axp-list@redhat.com
Subject: Re: an evil memcpy() optimizer bug! (egcs-1.1.2, alphaev6, linux)
Date: 13 Jul 1999 00:27:22 +0300 [thread overview]
Message-ID: <m3pv1x8sp1.fsf@vermis.bfr.co.il> (raw)
In-Reply-To: Joachim Wesner's message of "Mon, 12 Jul 1999 23:54:49 +0200"
Joachim Wesner <Joachim.Wesner@frankfurt.netsurf.de> writes:
> Alexander L. Belikoff wrote:
> >
> > "Wes Bauske" <wsb@paralleldata.com> writes:
> >
> > > Try modifying your code to pass the address of a double rather
> > > than the double itself and see if you still can create the
> > > problem. I've seen problems passing floats/doubles to functions
> > > rather than their addresses. I just pass the address instead.
> >
> > As you may have noticed, I didn't talk about workaround - there are
> > many of them. The one, I'm using now is that I have a temporary
> > volatile double v2 in put_f8() and I copy v into v2 and use the
> > latter. Other possible workarounds include, compiling put_f8() with
> > optimization turned off (it is not time-critical), or using manual
> > 'for' loop, rather than memcpy().
> >
>
> YEP, but actually I'd say this is a feature, not a bug ! If I remember
> correctly written
> somewhere in C standard, a temporary double arg, that will be passed in
> a *register*, as you **will** like it to happen at maximum optimization,
> simply has **NO** address to pass to memcpy. At best, the compiler can
> warn you and automatically generate one of the above workarounds you
> mention (with the SAME drawbacks), I don't think/expect there to exist a
> compiler smart enough to replace your case with one single optimized
> inline register to memory store or whatever. Or ???
Thank you for a very clear explanation. May I hope for a reference in
the standard or the Steel book? This really starts to scare me now -
what other surprises does the standard have?
--
Alexander L. Belikoff
Bloomberg L.P. / BFM Financial Research Ltd.
abel@vallinor4.com, abel@bfr.co.il
next prev parent reply other threads:[~1999-07-12 23:12 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-12 14:26 an evil memcpy() optimizer bug! (egcs-1.1.2, alphaev6, linux) Alexander L. Belikoff
1999-07-12 17:11 ` Wes Bauske
1999-07-12 16:38 ` Alexander L. Belikoff
1999-07-12 21:54 ` Joachim Wesner
1999-07-12 21:27 ` Alexander L. Belikoff [this message]
1999-07-13 10:08 ` Phil Carmody
1999-07-13 11:13 ` Joachim Wesner
1999-07-13 11:52 ` Dave Mason
1999-07-13 14:26 ` Phil Carmody
1999-07-13 14:58 ` seti at home Darren Breeze
1999-07-13 23:33 ` TurboTex
1999-07-14 1:19 ` Larry Snyder
1999-07-13 9:11 ` an evil memcpy() optimizer bug! (egcs-1.1.2, alphaev6, linux) Richard Henderson
1999-07-12 18:47 ` Uncle George
1999-07-12 19:42 ` Wes Bauske
1999-07-12 19:15 ` Alexander L. Belikoff
1999-07-12 22:09 ` Wes Bauske
1999-07-12 21:39 ` Alexander L. Belikoff
1999-07-13 2:19 ` Wes Bauske
1999-07-12 19:14 ` Richard Henderson
1999-07-12 19:12 ` Alexander L. Belikoff
1999-07-11 17:46 ` Jeff Sturm
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