> From what I understand of gcc (the GNU C compiler),
> the only thing that using "register" affects is what
> variables are retained by setjmp()/longjmp()
There are some ANSI C-compliant restrictions on what you can and cannot do with a
'register' variable. For instance, you can't apply it to something that won't fit in
the machine word length (like an array), and you cant take the address-of it with &.
> in registers, I think gcc ignores the "register"
> keyword when making those decisions.
>From the horses' mouth (7.1.1.3 in the 1997 ISO public review effort for C++)
3 A register specifier has the same semantics as an auto specifier together with a
hint to the implementation that the object so declared will be heavily used. [Note:
the hint can be ignored and in most implementations it will be ignored if the address
of the object is taken. --end note]
It's great that we have to deal with double talk like that these days :) After all,
these days something as supposedly horrendous as
[esp+4*edx+32]
doesn't actually cost a lot. In fact, placing demands on register inclusion can really
mess up the pipeline.
Chris Nash
Lexington KY
UNITED STATES
_________________________________________________________________
Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm
Mersenne Prime FAQ -- http://www.tasam.com/~lrwiman/FAQ-mers