Re: Register Variables in c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19/09/14 00:56, Ian Lance Taylor wrote:
> On Thu, Sep 18, 2014 at 2:15 AM, Ali Abdul Ghani <blade.vp2020@xxxxxxxxx> wrote:
>>
>> I have a question
>> I read about register variables
>> gcc Support register variables??
>>
>> or treat him like any other variable??
> 
> In GCC the only meanings of the register qualifier are that you can't
> the address of a register variable, and as a GCC extension you can
> declare the specific register that the variable should go into.
> 

I believe the register qualifier is used as a hint when you compile
without optimisation, and will encourage the compiler to put the
variable in a register rather than on the stack.  The hint is ignored
when optimising - they are treated as any other variable (other than
making it illegal to take an address), as the compiler will do a better
job of allocating variables to registers than a human would.

David






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux