From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 31713 invoked from network); 13 Jul 1999 09:32:40 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 13 Jul 1999 09:32:40 -0000 Received: from piglet.twiddle.net (root@piglet.twiddle.net [207.104.6.26]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id FAA01257 for ; Tue, 13 Jul 1999 05:26:30 -0400 Received: (from rth@localhost) by piglet.twiddle.net (8.8.7/8.8.7) id CAA05803 for axp-list@redhat.com; Tue, 13 Jul 1999 02:11:23 -0700 Date: Tue, 13 Jul 1999 02:11:23 -0700 From: Richard Henderson To: axp-list@redhat.com Subject: Re: an evil memcpy() optimizer bug! (egcs-1.1.2, alphaev6, linux) Message-ID: <19990713021123.A5788@twiddle.net> References: <378A21C6.1E094CB4@paralleldata.com> <378A6429.B183164A@frankfurt.netsurf.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.5i In-Reply-To: <378A6429.B183164A@frankfurt.netsurf.de>; from Joachim Wesner on Mon, Jul 12, 1999 at 11:54:49PM +0200 On Mon, Jul 12, 1999 at 11:54:49PM +0200, Joachim Wesner wrote: > 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 a > maximum optimization, simply has **NO** address to pass to memcpy. Hush, you're scaring the natives. No optimizing compiler should generate incorrect code for his put_8. It's a perfectly well formed standard-conforming function. Just too bad there was a bug in egcs 1.1 after I tried to do some optimizations on memcpy. > ... 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 ??? Certainly there is. That's what I'd been after in the first place. And with the buglet corrected, we get a single aligned load, followed by an unaligned store (due to the generalized char* buf argument) -- ldq_u $3,7($17) ldq_u $1,0($17) ldq $2,0($4) mskqh $3,$17,$3 mskql $1,$17,$1 insqh $2,$17,$4 insql $2,$17,$2 bis $3,$4,$3 bis $1,$2,$1 stq_u $3,7($17) stq_u $1,0($17) r~