From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 19515 invoked from network); 12 Jul 1999 20:46:18 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 12 Jul 1999 20:46:18 -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 QAA00050 for ; Mon, 12 Jul 1999 16:40:23 -0400 Received: by paralleldata.com from localhost (router,SLMail V2.5); Mon, 12 Jul 1999 15:44:54 -0500 Received: by paralleldata.com from paralleldata.com (207.136.51.245::mail daemon; unverified,SLMail V2.5); Mon, 12 Jul 1999 15:44:52 -0500 Sender: "Wsb" Message-ID: <378A4530.814245F6@paralleldata.com> Date: Mon, 12 Jul 1999 14:42:40 -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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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. Wes > Wes Bauske wrote: > > > Try modifying your code to pass the address of a double rather > > than the double itself and see if you still can create the > > > > > put_f8( > > > double v, /* in - value */ > > > char* buf /* in - destination address */ > > > ) > > > { > > > v = 99.875; > > > hexdump(stdout, "pack_f8: v", (char*) &v, 8); > > > memcpy(buf, &v, 8); > > > hexdump(stdout, "pack_f8: buf", (char*) buf, 8); > > > > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com