From: carmody@cpd.ntc.nokia.com (Phil Carmody)
To: axp-list@redhat.com
Subject: Re: an evil memcpy() optimizer bug! (egcs-1.1.2, alphaev6, linux)
Date: Tue, 13 Jul 1999 15:26:54 +0100 [thread overview]
Message-ID: <199907131426.PAA19008@mvagusta> (raw)
In-Reply-To: <378B1F63.1AEACAB0@frankfurt.netsurf.de> (Joachim.Wesner@frankfurt.netsurf.de)
>>>>> "J" == EXT Joachim Wesner <Joachim.Wesner@frankfurt.netsurf.de> writes:
J> Phil Carmody wrote:
>>
>> The 'YEP' paragraph has no connection to the ISO C language at all.
>>
>> There is no way an C coder can specify that a register be used for
>> either a variable or a parameter. One may hint, or suggest, but not specify.
>> It it the compiler's responsibility to ensure that anything one takes the
>> address of has an address, and thus is not solely stored in a register.
>> It was a bug, which is why it appears to have been fixed. Compilers,
>> however, are permitted to keyhole optimise and convert known length calls
>> to functions like memcpy into more efficient code. MSVC++ does this without
>> even breaking into a sweat.
J> Hu ??? OK, this is not really defined for arguments (and should work
J> anyhow, probably with an warning, as I wrote before), but my copy of K&R
J> says something like (Sorry, only have it in German, need to translate it
J> back):
J> The operator & can only be applied to variables and vector elements
J> ...<snip>... Also, taking
J> the adress of a variable of memory class register is illegal !
J> Maybe this has been changed in ISO C ?? Then, sorry for my ignorance.
Nope, you are right. But the direction you are looking at the implication
is different from mine.
When the language definition says you cannot take the address of a
register, it means that it is a semantic error on your part to try to take
the address of an automatic variable declared as a register. It won't
compile. However, it is a compiler error to not correctly provide the
address of an auto variable, even if you've turned every optimisation under
the sun on. (i.e. Compiler options about use of variables are very different
from use of the keyword 'register')
Phil
next prev parent reply other threads:[~1999-07-13 14:33 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
1999-07-13 14:26 ` Phil Carmody [this message]
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