Re: Is "register" generally ignored?

Maneki Neko <{spamtrap}>
9 Mar 2002 02:49:50 -0500

          From comp.compilers

Related articles
Is "register" generally ignored? (Scott Meyers) (2002-02-28)
Re: Is "register" generally ignored? {spamtrap} (Maneki Neko) (2002-03-09)
Re: Is "register" generally ignored? (2002-03-09)
Re: Is "register" generally ignored? (2002-03-09)
Re: Is "register" generally ignored? (Ray Dillinger) (2002-03-21)
| List of all articles for this month |

From: Maneki Neko <{spamtrap}>
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 <> 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

Post a followup to this message

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