This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: role of "register" C keyword?
- From: Ian Lance Taylor <iant at google dot com>
- To: Basile Starynkevitch <basile at starynkevitch dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 06 May 2010 13:22:27 -0700
- Subject: Re: role of "register" C keyword?
- References: <20100506121638.GA12476@hector.lesours>
Basile Starynkevitch <basile@starynkevitch.net> writes:
> Long time ago (probably in the GCC 2.95 & 3.2 time frame) I would
> imagine that the "register" keyword indeed affected register
> allocation, in the sense that variables declared with register where
> indeed & preferentially put in a machine register.
I don't think the "register" keyword ever affected register allocation
in gcc. For that you have to go back to compilers of the 1970s.
The register keyword does still have a use, though, in a gcc
extension: gcc uses it in combination with asm to implement register
variables.
> "The register storage class specifier keyword does not influence the
> optimization and performance of generated code. It only prohibits (for
> C code) the unary prefix addess-of operator &"
That would be appropriate in a general chapter on compiler
optimization. As far as I know we don't have one, but I certainly
wouldn't be opposed to adding one.
Ian