Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "Wes Bauske" <wsb@paralleldata.com>
To: axp-list@redhat.com
Subject: Re: an evil memcpy() optimizer bug! (egcs-1.1.2, alphaev6, linux)
Date: Mon, 12 Jul 1999 17:09:02 -0500	[thread overview]
Message-ID: <378A677E.60F3900D@paralleldata.com> (raw)
In-Reply-To: m3vhbp8yse.fsf@vermis.bfr.co.il

"Alexander L. Belikoff" wrote:
> 
> "Wes Bauske" <wsb@paralleldata.com> writes:
> 
> > Uncle George wrote:
> > >
> > > I thought he was!
> > > If he was passing the value, then he would have a problem, as the float is passed in the second floating
> > > point argument register ( rather than the second integer argument  register ).
> > >
> >
> > I wasn't clear. It's the 'v' in the put_f8() args that I meant.
> > The actual call to memcpy() is OK. I've seen this occur on other
> > platforms with high optimization levels, not particularly on Alphas.
> > That's why I prefer to modify my code since it isn't an Alpha
> > specific problem. For some reason, pass by value is more dangerous
> > for floats/doubles than ints/longs when you optimize. Pass by reference
> > hasn't failed for me yet.
> 
> What do you mean by 'more dangerous'? Is it only WRT to egcs 1.1.2's
> optimizer or something more generic?
> 
> --

I have other UNIX boxes where I get similar failures to your's.
Passing a float/double as an arg doesn't always produce the result
you would expect with high optimizations. So, I avoid it in
general in my own code. To me, it's just an idiosyncracy of coding
and optimizing C. I've seen it off and on over the past 2 years
or so. Possibly the optimizations in the newer compilers are
trying to be smarter than previously.

One of the previous replies at least now explains why it's a
problem, namely, the variable comes into the routine in a
FP reg and if you want to muck with it's address, there isn't
one without eliminating the optimization of using FP regs for
calling args.


Wes


  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
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 [this message]
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