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]

forcing a variable to be on the stack


Is there a way to ask gcc to force a specific variable to be stored on
the stack ? (other than write a bit of inline asm ?)

I tried something along the lines of the following (volatile on the
thread variable) and it appears to work but it's ugly and it's
probably stupid.
            {
              volatile PthreadFiberThread *thread = fiber->thread;
              pthread_cond_wait ((pthread_cond_t*)&thread->condvar,
                                           (pthread_mutex_t*)&thread->mutex);
              thread->trampoline->Jump ((PthreadFiberThread *)thread);
            }

Mathieu
-- 
Mathieu Lacage <mathieu.lacage@gmail.com>


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