This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: role of "register" C keyword?


On Thu, May 06, 2010 at 01:22:27PM -0700, Ian Lance Taylor wrote:
> 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.

register keyword has other uses, e.g. for -O0 code variables declared
with register keyword can be put into registers, while variables declared
without it always get stack slots.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]