From owner-freebsd-chat Tue Mar 16 20:57:14 1999 Delivered-To: freebsd-chat@freebsd.org Received: from poboxer.pobox.com (unknown [208.149.16.38]) by hub.freebsd.org (Postfix) with ESMTP id A1AA514BCE; Tue, 16 Mar 1999 20:56:56 -0800 (PST) (envelope-from alk@poboxer.pobox.com) Received: (from alk@localhost) by poboxer.pobox.com (8.9.3/8.9.1) id WAA55971; Tue, 16 Mar 1999 22:55:22 -0600 (CST) (envelope-from alk) From: Anthony Kimball MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 16 Mar 1999 22:55:18 -0600 (CST) X-Face: \h9Jg:Cuivl4S*UP-)gO.6O=T]]@ncM*tn4zG);)lk#4|lqEx=*talx?.Gk,dMQU2)ptPC17cpBzm(l'M|H8BUF1&]dDCxZ.c~Wy6-j,^V1E(NtX$FpkkdnJixsJHE95JlhO 5\M3jh'YiO7KPCn0~W`Ro44_TB@&JuuqRqgPL'0/{):7rU-%.*@/>q?1&Ed Reply-To: alk@pobox.com To: chat@freebsd.org Subject: Re: Use of "register" in code X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14063.12923.464399.183283@avalon.east> Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > I doubt it would make performance worse. I think GCC basically just > > ignores it for IA32. > It does ignore it. This is categorically wrong. GCC does not ignore "register" declarations. It honors the ANSI standard C semantics for register-qualified types in at least some circumstances, even without supplying -ansi or -pedantic options. I just tried it. > ... the compiler knows more > about temporaries and other usage than the programmer. Most of the time > (but not all of the time), that is true. This is certainly correct, but is beside the point, which illustrates the danger of the "register" keyword: Even experienced expert users who have not specialized in compilers or language semantics are decieved by the fact that the semantics of "register" in the ANSI dialect bear only a passing relationship to the ordinary technical use of the English word. I would like to make several points which this discussion has obscured to date: Firstly, removing "register" declarations from a program can cause correct code to become incorrect code. This is true, not only of ANSI C, but of the GNU C 2 series compilers, as well as other significant current compilers, such as Microsoft and SunPro. Secondly, producing such code is not easy, and it is very unlikely that any given use of the keyword in the source base will meet the necessary conditions to demonstrate this fact. Thirdly, most instances of the keyword are not intentionally being used to produce ANSI semantics. Instead, the author's intention was to effect the manual optimization of K & R's "register" keyword. It is this intention which is justifiably belittled by the majority of commentators in this thread. Finally, David O'Brien's quote from ANSI X3.159-1989 proves that Andrew O'Rielly's characterization of the meaning of "register" is fair and justified. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message