This is the mail archive of the gcc-help@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: forcing a variable to be on the stack


On 10/06/2010 04:20 PM, Andrew Haley wrote:
> On 10/06/2010 04:11 PM, Mathieu Lacage wrote:
>> Is there a way to ask gcc to force a specific variable to be stored on
>> the stack ?
> 
> Take its address.
> 
>> (other than write a bit of inline asm ?)
> 
> Nothing wrong with that:
> 
>  asm volatile ("" ::"a"&foo);

Sheesh.

asm volatile ("" ::"r"(&foo));


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