From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 24351 invoked from network); 12 Jul 1999 23:12:54 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 12 Jul 1999 23:12:54 -0000 Received: from paralleldata.com (smtp.paralleldata.com [38.153.145.2]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id TAA14683 for ; Mon, 12 Jul 1999 19:06:56 -0400 Received: by paralleldata.com from localhost (router,SLMail V2.5); Mon, 12 Jul 1999 18:11:24 -0500 Received: by paralleldata.com from paralleldata.com (207.136.51.144::mail daemon; unverified,SLMail V2.5); Mon, 12 Jul 1999 18:11:22 -0500 Sender: "Wsb" Message-ID: <378A677E.60F3900D@paralleldata.com> Date: Mon, 12 Jul 1999 17:09:02 -0500 From: "Wes Bauske" Organization: PDS Inc. X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.5-15 i686) X-Accept-Language: en MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: an evil memcpy() optimizer bug! (egcs-1.1.2, alphaev6, linux) References: <378A21C6.1E094CB4@paralleldata.com> <378A384F.3439D26A@voicenet.com> <378A4530.814245F6@paralleldata.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Alexander L. Belikoff" wrote: > > "Wes Bauske" 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