Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Dave Mason <dmason@sarg.Ryerson.CA>
To: axp-list@redhat.com
Subject: Re: an evil memcpy() optimizer bug! (egcs-1.1.2, alphaev6, linux)
Date: Tue, 13 Jul 1999 07:52:16 -0400	[thread overview]
Message-ID: <199907131152.HAA31220@sarg.Ryerson.CA> (raw)
In-Reply-To: Your message of "Tue, 13 Jul 1999 13:13:39 +0200." <378B1F63.1AEACAB0@frankfurt.netsurf.de>

>>>>> On Tue, 13 Jul 1999 13:13:39 +0200, Joachim Wesner <Joachim.Wesner@frankfurt.netsurf.de> said:

> The operator & can only be applied to variables and vector elements
> ...<snip>... 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


  reply	other threads:[~1999-07-13 11:59 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 [this message]
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
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