Re: Is "register" generally ignored?

Maneki Neko <{spamtrap}@erewhon.demon.co.uk>
9 Mar 2002 02:49:50 -0500

          From comp.compilers

Related articles
Is "register" generally ignored? smeyers@aristeia.com (Scott Meyers) (2002-02-28)
Re: Is "register" generally ignored? {spamtrap}@erewhon.demon.co.uk (Maneki Neko) (2002-03-09)
Re: Is "register" generally ignored? fjh@cs.mu.OZ.AU (2002-03-09)
Re: Is "register" generally ignored? rkrayhawk@aol.com (2002-03-09)
Re: Is "register" generally ignored? bear@sonic.net (Ray Dillinger) (2002-03-21)
| List of all articles for this month |

From: Maneki Neko <{spamtrap}@erewhon.demon.co.uk>
Newsgroups: comp.compilers
Date: 9 Mar 2002 02:49:50 -0500
Organization: Compilers Central
References: 02-02-067
Keywords: C, optimize
Posted-Date: 09 Mar 2002 02:49:50 EST

Scott Meyers <smeyers@aristeia.com> writes:
[Snip, but he knows about register and &]
> Is it reasonable to assume that contemporary C and C++
> compilers will ignore use of "register" when generating optimized
> code?


No C compiler has ever been *required* to put a register variable in a
physical register, that aspect of 'register' has only ever been a
hint. To see why, simply consider the case of a machine with N
available registers and a piece of code with N+1 simultaneously active
register variables, or the use of 'register' with a non-simple type.


As a practical matter of programming, these days 'register' should be
pronounced 'ensure I don't take the address of this'. Apart from that
specific use, I gave up using register declarations about 10 years
ago.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.