Do not spill variables/registers on the stack
Stefan Schulze Frielinghaus
stefan@seekline.net
Wed Feb 2 20:50:00 GMT 2011
On Mi, 2011-02-02 at 21:32 +0100, Drasko DRASKOVIC wrote:
> On Wed, Feb 2, 2011 at 7:35 PM, Stefan Schulze Frielinghaus
> <stefan@seekline.net> wrote:
> > On Mi, 2011-02-02 at 11:08 -0700, Jeff Law wrote:
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> On 02/02/11 10:34, Philip Herron wrote:
> >>
> >> >
> >> > I am not quite sure what you are asking/trying to do but the register
> >> > keyword is used to tell the compiler keep this variable inside any
> >> > available registers which is useful if your going to use it alot in a
> >> > piece of code i would imagine it could speed up things alot.
> >> GCC ignores the "register" keyword.
> >
> > GCC does _not_ ignore the "register" keyword.
>
> Are you sure ? I mean, are you sure what Jeff was suggesting with his
> short and not elaborated answer ?
> I mean, what if he wanted to say : " GCC ignores the 'register'
> keyword if no-optimization (-O0) flag was passed." ?
>
> That's why I asked for clarification, for in that case he might be right.
I took his words as a "for all" statement and proved by a counter
example that at least in one case it is not true ;-)
No seriously, just wait for his respond. There might be situations where
the keyword is ignored. I can only guess ...
Kind regards,
Stefan
More information about the Gcc-help
mailing list