From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 10337 invoked from network); 13 Jul 1999 11:59:31 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 13 Jul 1999 11:59:31 -0000 Received: from sarg.Ryerson.CA (root@sarg.Ryerson.CA [141.117.18.117]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id HAA18016 for ; Tue, 13 Jul 1999 07:53:20 -0400 Received: from sarg.Ryerson.CA (dmason@localhost [127.0.0.1]) by sarg.Ryerson.CA (8.8.7/8.8.7) with ESMTP id HAA31220 for ; Tue, 13 Jul 1999 07:52:16 -0400 Message-Id: <199907131152.HAA31220@sarg.Ryerson.CA> To: axp-list@redhat.com Subject: Re: an evil memcpy() optimizer bug! (egcs-1.1.2, alphaev6, linux) In-reply-to: Your message of "Tue, 13 Jul 1999 13:13:39 +0200." <378B1F63.1AEACAB0@frankfurt.netsurf.de> Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII Date: Tue, 13 Jul 1999 07:52:16 -0400 From: Dave Mason >>>>> On Tue, 13 Jul 1999 13:13:39 +0200, Joachim Wesner said: > The operator & can only be applied to variables and vector elements > ...... Also, taking the adress of a variable of memory class > register is illegal ! > Maybe this has been changed in ISO C ?? Then, sorry for my > ignorance. int foo(double x, int y) { ... &x ... &y is all legal. int foo(register double x,register int y) { ... &x ... &y isn't! So don't worry. C is a screwed up language in lots of ways, but this isn't one of them! Unfortunately optimization of these special cases, while sometimes important for performance, can create subtle bugs in the compiler. That was what happened here. In the ``good old days'' on PDP11s, VAXen, and i386s, parameters were all in memory, so this was easy to get right (but they were bog slow!). Passing parameters in registers is a good thing, but compiler writers just need to be more clever and careful. ../Dave